Last active
August 3, 2021 20:07
-
-
Save phatmandrake/0ba49f50990421dac46d70e4aea78d8e to your computer and use it in GitHub Desktop.
Get the BundleID and CodeSignRequirement from an app bundle by specifying the path. You can then create PPPC profiles directly in JAMF.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-MacOSCodeSign { | |
param ( | |
[parameter(Mandatory)] | |
[String]$AppPath | |
) | |
process { | |
$CodesignBundleID = (ConvertFrom-StringData -StringData $(codesign -dv $AppPath 2>&1 | Out-String)).identifier | |
$CodesignRequirement = (($(codesign -dr - $AppPath 2>&1) | Out-String) | Select-String "(?<=designated \=> ).*").matches.value | |
@{ | |
BundleID = $CodesignBundleID | |
CodeRequirement = $CodesignRequirement | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment