Invoke-Sqlcmd unable to run

前端 未结 4 1722
一向
一向 2021-01-04 14:13

I have a PowerShell script that checks the CPU level of the server it is running on, and then if it is above a certain threshold it will run a SQL stored procedure and e-mai

4条回答
  •  孤城傲影
    2021-01-04 15:03

    PowerShell v2 doesn't auto-load modules, so you need to load the relevant modules or snapins yourself:

    Add-PSSnapin SqlServerCmdletSnapin100
    Add-PSSnapin SqlServerProviderSnapin100
    

    [Source]

提交回复
热议问题