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){
|
switch($Template){
|
||||||
"Default" {
|
"Default" {
|
||||||
New-Item -Type Directory (Join-Path $pkgPath 'profile.d')
|
function SafeMk{param([string]$Path,[string]$PathType="Directory")
|
||||||
New-Item -Type Directory (Join-Path $pkgPath 'Aliases')
|
if( Test-Path $Path ) { return }
|
||||||
New-Item -Type Directory (Join-Path $pkgPath 'src')
|
$local:newItemParam = @{
|
||||||
New-Item -Type File -Path (Join-Path (Join-Path $pkgPath 'profile.d') 'env.local.ps1') -Value ''
|
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'
|
$jsonPath = Join-Path $pkgPath '_.package.json'
|
||||||
|
|
|
@ -91,6 +91,8 @@ class szCondition {
|
||||||
[string[]]$System = $null
|
[string[]]$System = $null
|
||||||
[string[]]$Hostname = $null
|
[string[]]$Hostname = $null
|
||||||
[string[]]$Username = $null
|
[string[]]$Username = $null
|
||||||
|
[string[]]$CmdletExists = $null
|
||||||
|
[string[]]$AppExeExists = $null
|
||||||
[szLogic]$Logic = [szLogic]::and
|
[szLogic]$Logic = [szLogic]::and
|
||||||
|
|
||||||
[string] ToString() {
|
[string] ToString() {
|
||||||
|
|
Loading…
Reference in New Issue