This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Powershell Monitor runs as version 1.0

Hello!

I'm working on a monitor to execute a multiple SQL queries and manipulate the data. To do so, I am using the Invoke-Sqlcmd cmdlet to run the query. The script works just fine when saved as a ps1 file and run manually on the server.

pastedImage_4.png

BUT, in SAM, it gives the following error:

pastedImage_1.png

So after some research, I decided to check the Powershell version, and it shows as 1.0 in the application monitor.

pastedImage_2.png

Any ideas on why this is happening? I'm running the script as Local and impersonating credentials:

pastedImage_5.png

  • Solution for those desperately trying to google it:

    Powershell WAS running as v5, but the command I was running was showing v1 for some reason. The problem with my script is that I did not have the SqlServer module installed on the server I was polling against. To fix this, run the following command:

    Install-Module -Name SqlServer

    Once it's installed, the Invoke-Sqlcmd function will work just fine.