Skip to content

Commit

Permalink
handling a null case
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelhor committed Jan 23, 2022
1 parent 8bfe55b commit 61fbc74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/Build-CustomPolicies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ try{
$XmlPolicyFiles = Get-ChildItem -Path $FilePath -Filter *.xml
Write-Verbose "Files found: $XmlPolicyFiles"

#Get the app settings
$EnvironmentsRootPath = Join-Path $FilePath ($AppSettingsJson.EnvironmentsFolder ?? "Environments")
#Get the app settings
$EnvironmentFolder = if ($null -eq $AppSettingsJson.EnvironmentsFolder) { "Environments" } else { $AppSettingsJson.EnvironmentsFolder }
$EnvironmentsRootPath = Join-Path $FilePath $EnvironmentFolder

#Ensure environments folder exists
if((Test-Path -Path $EnvironmentsRootPath -PathType Container) -ne $true)
Expand Down

0 comments on commit 61fbc74

Please sign in to comment.