Updated MyPackage code
Better handling of package creation/modification via Set-MyPackage Update the szCondition class to include CmdletExists+AppExeExists
This commit is contained in:
parent
23e4c03c92
commit
60825c92c8
|
@ -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'
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue