Skip to content

Commit d1c2dd2

Browse files
committed
change logic for whether catalog can be created based on whether new-filecatalog exists rather than IsWindows variable which doesn't exist on PS5
1 parent 78a2585 commit d1c2dd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ function New-Catalog
332332
{
333333
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseCompatibleCommands', '')]
334334
param ( [Parameter()]$Location )
335-
if ( ! $IsWindows ) {
336-
Write-Warning "Create catalog only on windows"
335+
$newFileCatalog = Get-Command -ea silentlycontinue New-FileCatalog
336+
if ($null -eq $newFileCatalog) {
337+
Write-Warning "New-FileCatalog not found, not creating catalog"
337338
return
338339
}
339340
try {

0 commit comments

Comments
 (0)