Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Public/New-IntuneWin32AppRequirementRuleScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ function New-IntuneWin32AppRequirementRuleScript {

# Convert script file contents to base64 string
$ScriptContent = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Content -Path "$($ScriptFile)" -Raw -Encoding UTF8)))
# Get-Content -Raw will remove BOM UTF8 char, adding the Base64 version of that
# Scripts in powershell 5.1 written in UTF8 need the BOM char
$ScriptContent = "77u/" + $ScriptContent

switch ($PSCmdlet.ParameterSetName) {
"String" {
Expand Down Expand Up @@ -330,4 +333,4 @@ function New-IntuneWin32AppRequirementRuleScript {
# Handle return value with constructed requirement rule for file
return $RequirementRuleScript
}
}
}