Trouble with deploying a powershell script package

Draconna 476 Reputation points
2022-05-12T13:26:47.963+00:00

Hello, I have a 1 line powershell script I am trying to deploy to a test machine via packages. I have tested the script on my own computer locally and it is working. It is supposed to copy a icon to the my desktop. The trouble is when I try to run it through sccm. I am not sure if it is the command line. I have tried a few different commands so far.

Not knowing which is best, I tried:

copysierra.ps1

Powershell.exe -ExecutionPolicy ByPass -copysierra.PS1

"%Windir%\sysnative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -Command .\copysierra.ps1

Here is my script:

201445-image.png

Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Garth 5,801 Reputation points
    2022-05-13T10:19:05.983+00:00

    The problem is you are copying the file from a unc, which the local system doesn't have access to. Include the file with the PowerShell script and copy it from the cache.


1 additional answer

Sort by: Most helpful
  1. AllenLiu-MSFT 40,316 Reputation points Microsoft Vendor
    2022-05-13T01:25:54.59+00:00

    Hi, @ChristopherWhalen-6797

    Thank you for posting in Microsoft Q&A forum.

    You may refer to Jason's article to use a bat file to copy files to clients easily.
    https://home.memftw.com/copying-files-to-clients-using-configmgr/


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments