Support Forum: Get Support for Patch My PC Products and Services

Microsoft Configuration Manager and Intune (Enterprises/Paid) => Support and General Questions (Enterprises Using ConfigMgr and Intune) => Topic started by: JEwens on July 18, 2023, 08:46:13 AM

Title: Post Script Path Info
Post by: JEwens on July 18, 2023, 08:46:13 AM
I'm trying to copy a new CACerts file over after I've installed Java. I added both a PostScript powershell and the path to the CACerts file in Additional files.

I can see in the logs that the script that I've specified is running, but I can't get it to find the CACerts file in the additional files.  Is there a variable I need to be using?

I currently have this.   

Copy-Item -Path "$PSScriptRoot\cacerts" -Destination "C:\Program Files (x86)\Java\jre1.8.0_361\lib\security\cacerts" -Force
Title: Re: Post Script Path Info
Post by: Andrew Jimenez (Patch My PC) on July 18, 2023, 09:56:13 AM
Hello, is it possible for you to upload a screenshot? I'd be interested to see the post script window as you have it configured in Patch My PC. If you don't want to upload here, feel free to open a case and email [email protected].
Title: Re: Post Script Path Info
Post by: Andrew Jimenez (Patch My PC) on July 24, 2023, 12:07:36 PM
Thanks! I removed the screenshot because it wasn't properly redacted. The way you have this set up, it should work. Is this ConfigMgr or Intune? Are you able to see that both the script and the additional file are both included in the content.
Title: Re: Post Script Path Info
Post by: JEwens on July 24, 2023, 03:02:24 PM
The logs say that they find the powershell and run it.  I don't have much error handling in it right now.  I'm just trying to get it to copy the file to the target computer and I don't know the syntax to reference the post script location.  I'm currently trying something like this.

Copy-Item -Path ".\cacerts" -Destination "C:\Program Files\Java\jre1.8.0_361\lib\security\cacerts"
Title: Re: Post Script Path Info
Post by: Andrew Jimenez (Patch My PC) on July 24, 2023, 04:19:47 PM
Hey, I just realized, is the issue that the destination path doesn't exist? I see your script specifically is attempting to copy the file to jre1.8.0_361, when the latest java is 371.
Title: Re: Post Script Path Info
Post by: JEwens on July 25, 2023, 12:16:51 PM
Good call. My initial testing was with 361.  I'll update and test again.