i trying create shell script run query , store output, , i've got script looking far:
push-location; import-module sqlps; pop-location; $mydata = invoke-sqlcmd -inputfile "c:\<path>\blah.sql" -serverinstance dbatest -database testdb; $mydata | out-file c:\users\<path>\shelloutput.csv; remove-module sqlps; it loads sqlps fine can check with get-module -listavailable producing this
but when invoke-sqlcmd not recognized:
any ideas else can do?
edit 1
when add option -verbose see error
saying files present. error preventing me loading module? when get-module doesn't list sqlps module.
edit 2
loading 32 bit version gives me fewer errors still errors loading files...now 2 files missing opposed 5 earlier
Comments
Post a Comment