diff --git a/base/Set-MyPackage.ps1 b/base/Set-MyPackage.ps1 index a8a165d..a63dba7 100644 --- a/base/Set-MyPackage.ps1 +++ b/base/Set-MyPackage.ps1 @@ -46,10 +46,19 @@ process { } switch($Template){ "Default" { - New-Item -Type Directory (Join-Path $pkgPath 'profile.d') - New-Item -Type Directory (Join-Path $pkgPath 'Aliases') - New-Item -Type Directory (Join-Path $pkgPath 'src') - New-Item -Type File -Path (Join-Path (Join-Path $pkgPath 'profile.d') 'env.local.ps1') -Value '' + function SafeMk{param([string]$Path,[string]$PathType="Directory") + if( Test-Path $Path ) { return } + $local:newItemParam = @{ + Type = $PathType + Path = $Path + } + if( $PathType -eq 'File' ) { $newItemParam.Value = '' } + New-Item -Type $PathType $Path + } + SafeMk (Join-Path $pkgPath 'profile.d') + SafeMk (Join-Path $pkgPath 'Aliases') + SafeMk (Join-Path $pkgPath 'src') + SafeMk -PathType 'File' (Join-Path (Join-Path $pkgPath 'profile.d') 'env.local.ps1') } } $jsonPath = Join-Path $pkgPath '_.package.json' diff --git a/base/src/Packagesz.class.inc.ps1 b/base/src/Packagesz.class.inc.ps1 index a10ab35..3c90b9d 100644 --- a/base/src/Packagesz.class.inc.ps1 +++ b/base/src/Packagesz.class.inc.ps1 @@ -91,6 +91,8 @@ class szCondition { [string[]]$System = $null [string[]]$Hostname = $null [string[]]$Username = $null + [string[]]$CmdletExists = $null + [string[]]$AppExeExists = $null [szLogic]$Logic = [szLogic]::and [string] ToString() {