I get the following error when running Powershell in a SQL Agent job:
The error information returned by PowerShell is: 'The term 'Read-SQLTableData' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. '. Process Exit Code -1.The step works when running in Powershell ISE itself and I have recently upgraded to Powershell V5.
When I run “$psversiontable” in the SQL Agent jobstep it returns:
PSVersion 5.1.14409.1018"Get-Command -Name SQLTableData" retruns:
` Read-SqlTableData Write-SQlTableData ` So the SQL Agent appears to have the correct version and the desired commands appear to be there, but I still get an error when running with either Read-SQLTableData or Write-SQLTableData thru a SQL Agent job. I also updated dbo.syssubsystems but all the Poweshell executables appear to be V1, does this matter?