-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a Remove-Template command #31
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1101,6 +1101,31 @@ function New-PWItem{ | |
} | ||
Set-Alias Add-Item New-PWItem -Description 'obsolete: This was added for back compat and will be removed soon' | ||
|
||
function Remove-PWTemplate{ | ||
[cmdletbinding()] | ||
param( | ||
[Parameter(Position=1,Mandatory=$true)] | ||
[ValidateNotNullOrEmpty()] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to remove this validation and then just skip empty values in |
||
[string[]]$TemplateNames | ||
) | ||
process{ | ||
|
||
<# Make a copy of the old template array #> | ||
$templates = $Global:pecanwafflesettings.Templates | ||
|
||
<# Create new template array #> | ||
$Global:pecanwafflesettings.Templates = @() | ||
|
||
<# Filter out templates #> | ||
foreach($template in $templates){ | ||
if($TemplateNames -notcontains $template.Name){ | ||
$Global:pecanwafflesettings.Templates += $template | ||
} | ||
} | ||
} | ||
} | ||
Set-Alias Remove-Template Remove-PWTemplate | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you add this because of the other |
||
|
||
function InternalGet-EvaluatedPropertiesFrom{ | ||
[cmdletbinding()] | ||
param( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add
ValueFromPipeline=$true
here? This will enable piping for example'aspnet-empty`,`aspnet-web` | Remove-PWTemplate