Powershell (SQL Server 2008 R2)

Welcome Forums General PowerShell Q&A Powershell (SQL Server 2008 R2)

This topic contains 1 reply, has 2 voices, and was last updated by

9 months, 4 weeks ago.

  • Author
  • #101163

    Points: 0
    Rank: Member

    I am trying to create a SQL Server agent job that will run powershell commands in SQL Server 2008 R2. I keep getting errors. A lot of powershell commands it does not recognize (i.e. Import-module, Get-module, Invoke-cmd, etc). This is the error message I get "The term 'get-module' is not recognized as the name of a cmdlet, function, script file, or operable program." It works fine in the powershell ISE console. Any ideas on my problem?

  • #101167

    Points: 1,071
    Helping Hand
    Rank: Community Hero

    These are all base cmdlets in PoSH (Host / ISE / VSCode).
    If you are not able to run them, then you are not in a PoSH environment.

    See if the below gets you to where you need to be.

    Run Windows PowerShell Steps in SQL Server Agent

    Running PowerShell in a SQL Agent Job

    Running PowerShell in a SQL Agent Job

The topic ‘Powershell (SQL Server 2008 R2)’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort