Deploy PS script via SCCM package

This topic contains 7 replies, has 2 voices, and was last updated by Profile photo of Will Anderson Will Anderson 7 months, 3 weeks ago.

  • Author
    Posts
  • #37615
    Profile photo of David Zemdegs
    David Zemdegs
    Participant

    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
    Profile photo of David Zemdegs
    David Zemdegs
    Participant

    Error lines not displaying?

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

  • #37617
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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
    Profile photo of David Zemdegs
    David Zemdegs
    Participant

    Windows 7

  • #37619
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    Just updated my reply above. Sorry. 😉

  • #37620
    Profile photo of David Zemdegs
    David Zemdegs
    Participant

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

  • #37621
    Profile photo of David Zemdegs
    David Zemdegs
    Participant

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

  • #37622
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

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

You must be logged in to reply to this topic.