• Welcome to Support Forum: Get Support for Patch My PC Products and Services.
 

Custom Pre/Post Script with Product Name and Vendor

Started by alecdombrowski, February 09, 2024, 11:59:37 AM

Previous topic - Next topic

alecdombrowski

I'm setting up pre and post scripts to log to the event viewer when PMPC installs or updates an app (Intune). I am trying to pass the vendor name and product name but PMPC is passing some odd string instead of actual app and vendor names. I have only tested with Amazon Workspace, but before I test more I want to know if this is normal and should be expected

In order...
-MyParameter "%VendorName%, %ProductName%, %Version%, %PackageID%"
QW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLg==  QW1hem9uIFdvcmtTcGFjZXM=  5.18.0.4508  7d614a86-0cfc-44ff-b9e2-d13fa6c64a27  0

Cody Mathis (Patch My PC)

Hi there!

We have some documentation for this. We encode the values to ensure they do not cause any parsing issues. See the documentation below for an example of decoding the value in your script.

https://patchmypc.com/pass-variables-into-pre-and-post-scripts

alecdombrowski

Awesome, ty!

Does that mean this article here may not be valid? It talks about how the you can't use traditional PowerShell syntax to pass an array for the arguments. It looks like the article you linked above is allowing multiple arugements to be used, which I'm assuming the script has them in an array? https://patchmypc.com/custom-options-available-for-third-party-updates-and-applications#custom-scripts

"Note: When specifying a PowerShell .ps1 script file for either a pre or post-update script, and you attempt to pass an argument which accepts an array, you cannot use traditional PowerShell syntax."

Cody Mathis (Patch My PC)

This would still apply as well. Note it is very specifically if an argument accepts an array of strings.

alecdombrowski

Oh I misread the article then, thanks for the help!

Cody Mathis (Patch My PC)

Glad to help! Feel free to reach back out if you run into any trouble.