|
12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- Param(
- [Parameter(Mandatory = $true)]
- [string]
- $PropertyNames,
-
- [Parameter()]
- [string]
- $EdgeRCFile,
-
- [Parameter()]
- [string]
- $Section
- )
-
- $CommonParams = @{
- EdgeRCFile = $EdgeRCFile
- Section = $Section
- }
- $PropertyNamesArray = $PropertyNames -split ','
-
- $StrictHeaderParsing = '{
- "name": "strictHeaderParsing",
- "options": {
- "validMode": false,
- "strictMode": false
- }
- }' | ConvertFrom-Json
-
- foreach ($PropertyName in $PropertyNamesArray) {
- $Property = Get-Property -PropertyName $PropertyName.Trim() @CommonParams
- # Latest version of property is active
- if ($Property.latestVersion -eq $Property.stagingVersion -or $Property.latestVersion -eq $Property.productionVersion) {
- Write-Host -ForegroundColor Yellow "$PropertyName`: Creating new version of property"
- $NewVersionResult = New-PropertyVersion -PropertyName $PropertyName -CreateFromVersion latest @CommonParams
- }
-
- $Rules = Get-PropertyRuleTree -PropertyName $PropertyName -PropertyVersion latest @CommonParams
- $Rules.rules.behaviors += $StrictHeaderParsing
- Write-Host -ForegroundColor Yellow "$PropertyName`: Pushing new rules"
- $Rules | Set-PropertyRuleTree -PropertyName $PropertyName -PropertyVersion latest -VersionNotes 'Updating behaviour by pwsh' @CommonParams
- Write-Host -ForegroundColor Yellow "$PropertyName`: Activating to staging"
- $ActivationResult = Activate-Property -PropertyName $PropertyName -PropertyVersion latest -Network Staging @CommonParams
- }
|