Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 23 additions & 14 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -634,32 +634,41 @@ Fix steps:
}

# publish powershell.config.json
$config = @{}
$config = [ordered]@{}

if ($Options.Runtime -like "*win*") {
# Execution Policy is only supported on Windows
$config = @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned";
"WindowsPowerShellCompatibilityModuleDenyList" = @("PSScheduledJob", "BestPractices", "UpdateServices")
}
# Execution Policy and WinCompat feature are only supported on Windows.
$config.Add("Microsoft.PowerShell:ExecutionPolicy", "RemoteSigned")
$config.Add("WindowsPowerShellCompatibilityModuleDenyList", @("PSScheduledJob", "BestPractices", "UpdateServices"))
}

if (-not $SkipExperimentalFeatureGeneration -and
(Test-IsPreview $psVersion) -and
-not (Test-IsReleaseCandidate $psVersion)
) {

$ExperimentalFeatureJsonFilePath = if ($Options.Runtime -like "*win*") {
"$PSScriptRoot/experimental-feature-windows.json"
if (-not $env:PS_RELEASE_BUILD -and -not $Runtime.Contains("arm") -and -not ($Runtime -like 'fxdependent*')) {
Write-Verbose "Build experimental feature list by running 'Get-ExperimentalFeature'" -Verbose
$json = & $publishPath\pwsh -noprofile -command {
$expFeatures = Get-ExperimentalFeature | ForEach-Object -MemberName Name
ConvertTo-Json $expFeatures
}
} else {
"$PSScriptRoot/experimental-feature-linux.json"
}
Write-Verbose "Build experimental feature list by using the pre-generated JSON files" -Verbose
$ExperimentalFeatureJsonFilePath = if ($Options.Runtime -like "*win*") {
"$PSScriptRoot/experimental-feature-windows.json"
} else {
"$PSScriptRoot/experimental-feature-linux.json"
}

if (-not (Test-Path $ExperimentalFeatureJsonFilePath)) {
throw "ExperimentalFeatureJsonFilePath: $ExperimentalFeatureJsonFilePath does not exist"
}

if (-not (Test-Path $ExperimentalFeatureJsonFilePath)) {
throw "ExperimentalFeatureJsonFilePath: $ExperimentalFeatureJsonFilePath does not exist"
$json = Get-Content -Raw $ExperimentalFeatureJsonFilePath
}

$json = Get-Content -Raw $ExperimentalFeatureJsonFilePath
$config += @{ ExperimentalFeatures = ([string[]] ($json | ConvertFrom-Json)) }
$config.Add('ExperimentalFeatures', [string[]]($json | ConvertFrom-Json));

} else {
Write-Warning -Message "Experimental features are not enabled in powershell.config.json file"
}
Expand Down
2 changes: 2 additions & 0 deletions tools/releaseBuild/azureDevOps/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ resources:
ref: master

variables:
- name: PS_RELEASE_BUILD
value: 1
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 1
- name: POWERSHELL_TELEMETRY_OPTOUT
Expand Down