none
Run PowerShell script from SQL RRS feed

  • Question

  • Hello,

    I have two SQL boxes one SQL 2014 Developer edition, and second SQL 21019 standard on two different Windows boxes. 

    My PowerShell script working  in SQL 2014 Developer but not in SQL 21019. It's  generate error  

    The term 'C:\Path_to_File\ExportToExcel.ps1' 
    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.


    I tested this script  from command line and it working perfectly.

    The sql code simple exec xp_cmdshell 'PowerShell.exe "C:\Path_to_File\ExportToExcel.ps1"'

    Run  command xp_cmdshell 'PowerShell.exe' doesn't generate any errors any errors 

    Windows PowerShell 
    Copyright (C) 2016 Microsoft Corporation. All rights reserved.
    NULL
    PS C:\Windows\system32> 


    Any ides?

    Thank you

    Konstantin


    Friday, November 6, 2020 8:46 PM

All replies

  • Hello Konstantin,

    This forum is dedicated to supporting issues related to open specification. You can access open specifications at https://docs.microsoft.com/en-us/openspecs/. Your inquiry does not seem to be related to open specifications.

    For a better chance of getting an answer to your question, you may want to post your question to the following forum:

    https://docs.microsoft.com/en-us/answers/products/sql-server

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications
    Sunday, November 8, 2020 4:10 PM
    Moderator
  • Thank you Tom
    Monday, November 9, 2020 2:07 PM