mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 01:34:19 +08:00
Create powershell.config.json
for PowerShell.Windows.x64
global tool (#23941)
This commit is contained in:
parent
167a492415
commit
bd8b0bd421
@ -287,6 +287,14 @@ jobs:
|
||||
# remove PDBs to reduce the size of the nupkg
|
||||
Remove-Item -Path "$outputPath\temp\tools\net9.0\any\*.pdb" -Recurse -Force
|
||||
|
||||
# create powershell.config.json
|
||||
$config = [ordered]@{}
|
||||
$config.Add("Microsoft.PowerShell:ExecutionPolicy", "RemoteSigned")
|
||||
$config.Add("WindowsPowerShellCompatibilityModuleDenyList", @("PSScheduledJob", "BestPractices", "UpdateServices"))
|
||||
|
||||
$configPublishPath = Join-Path "$outputPath" 'temp' 'tools' 'net8.0' 'any' "powershell.config.json"
|
||||
Set-Content -Path $configPublishPath -Value ($config | ConvertTo-Json) -Force -ErrorAction Stop
|
||||
|
||||
Compress-Archive -Path "$outputPath\temp\*" -DestinationPath "$outputPath\$nupkgName" -Force
|
||||
|
||||
Remove-Item -Path "$outputPath\temp" -Recurse -Force
|
||||
|
Loading…
Reference in New Issue
Block a user