@mikeyt23/node-cli-utils
    Preparing search index...

    Function getPowershellHackArgs

    • Powershell doesn't load the system PSModulePath when running in a non-interactive shell. This is a workaround to set the PSModulePath environment variable to the system value before running a powershell command.

      Warning: Do NOT use this for generating commands dynamically from user input as it could be used to execute arbitrary code. This is meant solely for building up known commands that are not made up of unsanitized user input, and only at compile time. See winInstallCert and winUninstallCert for examples of taking user input and inserting it safely into known commands.

      Parameters

      • command: string

        The powershell command to run

      Returns string[]

      An array of arguments to pass to spawnAsync with the "powershell" command as the first argument