Bmac 0 Posted January 22 My issue seems to be passing optional parameters through to scripts. Within my script I have something like the following param ( [string]$identity ) ... do stuff When I specify the -identity cbell in the optional parameters I am getting back the following error. Executing Script ..Processing -File 'C:\Windows\temp\myPSScript.ps1 -identity cbell' failed because the file does not have a '.ps1' extension. Specify a valid Windows PowerShell script file name, and then try again. I have tried with and without double/single quotes. Any ideas what I am doing wrong? Share this post Link to post Share on other sites
DarrenWhite99 307 Posted January 22 What script function are you using? Can you post a screenshot? What server version/patch? It looks like it is trying to use the entire command line as the filename. But without details on how you are calling the script I couldn’t guess what you are doing wrong. (Or maybe you found a fresh bug!) Share this post Link to post Share on other sites
Bmac 0 Posted January 22 Here is a quick example with some screenshots. I've tried this with different patterns within the scripts and the parameter line, meaning placing single and double quotes in different locations to see if it was anything with the parsing of the text. No change in the error. I'm told we are on version 0.2.2.4 - I have no idea of the current versioning of the product. I'm just the resident scripting guy. The error I get in the Terminal Window is: Sending script to agent ....... Script CMD = @powershell -NoProfile -ExecutionPolicy unrestricted -file "%windir%\temp\myPSScript.ps1 -identity "administrator"" Executing Script ...Processing -File 'C:\Windows\temp\myPSScript.ps1 -identity administrator' failed because the file does not have a '.ps1' extension. Specify a valid Windows PowerShell script file name, and then try again. For the screenshots in one I commented out the parameter assignment and specified the variable value, in the other I am passing the parameter argument just as I would from a normal console. Share this post Link to post Share on other sites
DarrenWhite99 307 Posted January 23 I’m not familiar with that plugin, but it’s definitely doing something wrong. (Or the behavior of Automate changed and impacted the plugin) Share this post Link to post Share on other sites