Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Basic Powershell question

I need to run a Powershell script that is usually invoked by a command and switch. How should I set up my steps to achieve this? I have zero Powershell experience.

.\Installerscript.ps1 -organization encryptionkeyhere

I've tried typing the above in the script window, and adding the switch to the command line box but neither worked. Both times the error returned was that -organization was not a recognised command.




Date Votes
  • Using a PowerShell step in a deployment package, you can copy the contents of the script and run it that way.

    Without knowing anything about your script (is it just a bunch of standalone cmdlets? is it a function?) it's hard to troubleshoot meaningfully. I would say check to make sure the default command line settings in the deploy package aren't going to interfere with the way the script runs.

    Perhaps try something like the below in a PowerShell step in PDQ Deploy:

    Import-Module <script path>

    Installerscript -organization encryptionkeyhere
  • Hi Monica, Chris from PDQ support suggested using an install step, with the PS1 added and my parameters in the parameters field. This worked fine, for most hosts at least.