Microsoft

System Center Configuration Manager Feedback

Suggestion box powered by UserVoice

How can we improve Configuration Manager?

Application Installation Program

Currently when we want to run PowerShell commands in an ConfigMgr Application we need to wrap them in a script or run them with powershell.exe -command and make it a oneliner. This is because it's always triggered from cmd.exe.
Would be nice to be able to choose to directly start PowerShell.exe and just run the PowerShell command.
An example of what I'd like to achieve is to simply add that command in the "installation program" field.
Add-WindowsCapability -Online -LimitAccess -Name Tools.Graphics.DirectX~~~~0.0.1.0 -Source .
Currently we have to use this oneliner instead which is far more complex.
Powershell.exe -NoLogo -NoProfile -NonInteractive -Command "Add-WindowsCapability -Name "Tools.Graphics.DirectX~~~~0.0.1.0" -Online -LimitAccess -Source (Get-Location).Path ; if (!$?) { $Host.SetShouldExit($Error[0].Exception.HResult) }"

12 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Anonymous commented  ·   ·  Flag as inappropriate

        What would be a nice to have is an option to set a minimum PS version as well.
        Maybe next to the installation program field or as a built-in Deployment Type condition.

      • Richard Archer commented  ·   ·  Flag as inappropriate

        Heck, I'd go one further and say you should be able to embed a PowerShell script in the Deployment Type configuration. ConfigMgr already supports embedding PS scripts in many other components, not having it in Deployment Types seems like an omission.

      Feedback and Knowledge Base