Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

NEW Package or task to copy powershell module

  • Thread starter Thread starter AhmedLS
  • Start date Start date
  • Replies Replies 1
  • Views Views 2K

AhmedLS

Well-Known Member
Messages
181
Solutions
17
Reaction score
17
Points
18
Hi,
i have been trying everything to copy a PS module to (program files/windowspowershell/modules) but with no luck. tried using powershell and batch file and in both cases nothing happens and no errors in the logs. just the copy doesnt happen. is there any restriction that i dont know about or may be something i am missing.
the module is located on a network share with all other apps that i deploy througt our distribution point.

the powershell command i am using is (running them manually within powershell on the client works).
copy-item $executingScriptDirectory\PackageManagement $env:ProgramFiles -force -Recurse
copy-item $executingScriptDirectory\WindowsPowershell $env:ProgramFiles -force -Recurse

the command within the package is
powershell.exe -executionpolicy Bypass -file ".\move-script.ps1"
 
Solution
i ran the above commands on the collection using "Run Script" and it worked. i kind of solved the issue as i deployed the module to my workstations but still looking for a solution using a package.
i ran the above commands on the collection using "Run Script" and it worked. i kind of solved the issue as i deployed the module to my workstations but still looking for a solution using a package.
 
Solution
Back
Top