Deploy PS script via SCCM package

Welcome Forums General PowerShell Q&A Deploy PS script via SCCM package

This topic contains 7 replies, has 2 voices, and was last updated by

 
Keymaster
2 years, 7 months ago.

  • Author
    Posts
  • #37615

    Participant
    Points: 21
    Rank: Member

    Greetings,
    I'm trying to deploy my first Powershell script via an SCCM 2010 R2 package.
    These are the errors from execmgr.log:

    
    
    
    
    
    
    
    
    
    
    
    
    

    Any ideas please?
    Thanks
    David

  • #37616

    Participant
    Points: 21
    Rank: Member

    Error lines not displaying?

    [LOG[Invalid data file "powershell.exe -noprofile -ExecutionPolicy bypass -file .\RebootAuto.ps1" to execute using file association]LOG]

  • #37617

    Keymaster
    Points: 12
    Team Member
    Rank: Member

    Just curious, what OS are you targeting?

    Also, try the following switches. I've had better luck with that in the past.

    "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File .\%PSScript%.ps1"

  • #37618

    Participant
    Points: 21
    Rank: Member

    Windows 7

  • #37619

    Keymaster
    Points: 12
    Team Member
    Rank: Member

    Just updated my reply above. Sorry. 😉

  • #37620

    Participant
    Points: 21
    Rank: Member

    Just tried that and got the same error about file association.

  • #37621

    Participant
    Points: 21
    Rank: Member

    Silly me. I had quotes around the command in the package definition

  • #37622

    Keymaster
    Points: 12
    Team Member
    Rank: Member

    ^_^ I should've thought about that. Well done!

The topic ‘Deploy PS script via SCCM package’ is closed to new replies.