2

I've got the powershell install script for the windows command-liner installer Scoop which is called: install.ps1. After downloading the script with

irm get.scoop.sh -outfile 'install.ps1'

I want to depoly it over the Intune-Portal. I am well aware that Intune got a section where you explicitly can deploy powershell scripts. I don't want to do it that way, because I want to learn/know how/if it's possible this way.

My question is, how the install-command for a powershell-script differs from the command used for an msi or an exe.

1 Answer 1

2

After some testing and researching I found out three things:

  • intune uses the cmd.exe-syntax under the hood and not powershell.exe-syntax
  • all commands are run in administrative mode
  • the scoop-installer does not like elevated rights by default and needs therefore a certain option

With these things in mind I can give intune the right command for an silent-install.

powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -NonInteractive -File install.ps1 -RunAsAdmin

I am executing the powershell with different options which bypass the ExecutionPolicy (if not already set) and hides/silences/quiets the opening powershell console.

After the -File option I declare the script which shall execute and the scoop-installer-specific -RunAsAdmin option. It is important to put the -File option at the end of the command, because everything after it, gets interpreted as part of install.ps1.

For the sake of completeness, here is also the silent-uninstall-command:

powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -NonInteractive -Command "del $HOME\scoop -Force -Recurse | Out-Null"

I know that the task of the uninstall-command, could also be achieved with pure cmd-syntax, but I wanted to stay close to the documentation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .