# Deploy PS script via SCCM package

**URL:** <https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202>\
**Category:** PowerShell Help\
**Created:** [April 12, 2016, 11:49am UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202 "2016-04-12T11:49:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![david-zemdegs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/david-zemdegs/32/1461_2.png) [@david-zemdegs](https://forums.powershell.org/u/david-zemdegs)\
**Post date:** [April 12, 2016, 11:49am UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/1 "2016-04-12T11:49:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![david-zemdegs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/david-zemdegs/32/1461_2.png) [@david-zemdegs](https://forums.powershell.org/u/david-zemdegs)\
**Post date:** [April 12, 2016, 11:52am UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/2 "2016-04-12T11:52:06Z")

</div>

Error lines not displaying?

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

---

<div class="post-metadata">

**Author:** ![will-anderson](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/will-anderson/32/234_2.png) [@will-anderson](https://forums.powershell.org/u/will-anderson)\
**Post date:** [April 12, 2016, 12:07pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/3 "2016-04-12T12:07:14Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![david-zemdegs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/david-zemdegs/32/1461_2.png) [@david-zemdegs](https://forums.powershell.org/u/david-zemdegs)\
**Post date:** [April 12, 2016, 12:08pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/4 "2016-04-12T12:08:13Z")

</div>

Windows 7

---

<div class="post-metadata">

**Author:** ![will-anderson](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/will-anderson/32/234_2.png) [@will-anderson](https://forums.powershell.org/u/will-anderson)\
**Post date:** [April 12, 2016, 12:10pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/5 "2016-04-12T12:10:55Z")

</div>

Just updated my reply above. Sorry. 😉

---

<div class="post-metadata">

**Author:** ![david-zemdegs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/david-zemdegs/32/1461_2.png) [@david-zemdegs](https://forums.powershell.org/u/david-zemdegs)\
**Post date:** [April 12, 2016, 12:15pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/6 "2016-04-12T12:15:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![david-zemdegs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/david-zemdegs/32/1461_2.png) [@david-zemdegs](https://forums.powershell.org/u/david-zemdegs)\
**Post date:** [April 12, 2016, 12:26pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/7 "2016-04-12T12:26:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![will-anderson](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/will-anderson/32/234_2.png) [@will-anderson](https://forums.powershell.org/u/will-anderson)\
**Post date:** [April 12, 2016, 12:32pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/8 "2016-04-12T12:32:16Z")

</div>

🙂 I should’ve thought about that. Well done!

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:41pm UTC](https://forums.powershell.org/t/deploy-ps-script-via-sccm-package/6202/9 "2024-05-16T20:41:38Z")

</div>

Closed on May 16, 2024, 8:41pm UTC


