From 806c507846e101b9051f0e040c15fbdd45bd4aee Mon Sep 17 00:00:00 2001 From: John Roos Date: Tue, 10 Nov 2020 22:19:22 +0100 Subject: [PATCH] Added help --- Public/Get-VarStash.ps1 | 24 ++++++++++++++++++++++++ Public/Get-VarStashBlackList.ps1 | 11 +++++++++++ Public/Pop-VarStash.ps1 | 24 ++++++++++++++++++++++++ Public/Push-VarStash.ps1 | 13 +++++++++++++ Public/Remove-VarStash.ps1 | 18 ++++++++++++++++++ Public/Show-VarStash.ps1 | 18 ++++++++++++++++++ 6 files changed, 108 insertions(+) diff --git a/Public/Get-VarStash.ps1 b/Public/Get-VarStash.ps1 index d65b1f3..d67246a 100644 --- a/Public/Get-VarStash.ps1 +++ b/Public/Get-VarStash.ps1 @@ -1,3 +1,27 @@ +<# +.SYNOPSIS + Gets one or more variable stashes. +.DESCRIPTION + Gets one or more variable stashes. Returns the name and the created date for each stash. +.EXAMPLE + Get-VarStash + + Gets all available variable stashes. +.EXAMPLE + Get-VarStash -Name MyStash + + Gets the variable stash called MyStash. + +.EXAMPLE + Get-VarStash -Name My* + + Gets variable stashes with names starting with 'My'. + +.EXAMPLE + Get-VarStash -Index 2 + + Gets the variable stash on index position 2 in the stash. Index starts with 0. +#> function Get-VarStash { [CmdletBinding(DefaultParameterSetName = '__AllParameterSets')] param( diff --git a/Public/Get-VarStashBlackList.ps1 b/Public/Get-VarStashBlackList.ps1 index f201f6e..a9b8c3d 100644 --- a/Public/Get-VarStashBlackList.ps1 +++ b/Public/Get-VarStashBlackList.ps1 @@ -1,3 +1,14 @@ +<# +.SYNOPSIS + Gets the variable stash black list. +.DESCRIPTION + Gets the variable stash black list. The black list contains variable names which will be ignored when pushing to variable stash. + These names are standard variables which are not user created. +.EXAMPLE + Get-VarStashBlackList + + Gets the variable stash black list. +#> function Get-VarStashBlackList { [CmdletBinding()] param() diff --git a/Public/Pop-VarStash.ps1 b/Public/Pop-VarStash.ps1 index 7b6a88f..d3e35a8 100644 --- a/Public/Pop-VarStash.ps1 +++ b/Public/Pop-VarStash.ps1 @@ -1,3 +1,27 @@ +<# +.SYNOPSIS + Pops a variable stash. +.DESCRIPTION + Pops a variable stash. This command restores all variables from a variable stash and then removes the stash from storage. The stash can optionally be kept using the -Keep parameter. +.EXAMPLE + Pop-VarStash + + Pops the variables from the top of the stash (latest stash, index 0). +.EXAMPLE + Pop-VarStash -Name MyStash + + Pops the variables from the stash with name 'MyStash'. + +.EXAMPLE + Pop-VarStash -Index 2 + + Pops the variables from the stash with index position 2 (lates stash has index 0). + +.EXAMPLE + Pop-VarStash -Keep + + Pops the variables from the top of the stash (latest stash, index 0). When using parameter -Keep, the stash will not be removed from storage (and the verb pop does not make any sense :) ). +#> function Pop-VarStash { [CmdletBinding(DefaultParameterSetName = 'Keep')] param( diff --git a/Public/Push-VarStash.ps1 b/Public/Push-VarStash.ps1 index 3289b59..aa88004 100644 --- a/Public/Push-VarStash.ps1 +++ b/Public/Push-VarStash.ps1 @@ -1,4 +1,17 @@ +<# +.SYNOPSIS + Pushes variables to the variable stash. +.DESCRIPTION + Pushes variables to the variable stash. The pushed variables will be stored on the top of the stash (index 0). +.EXAMPLE + Push-VariableStash + Pushes variables to the variable stash. Since the -Name parameter is omitted, a default name will be set (a guid). +.EXAMPLE + Push-VariableStash -Name MyStash + + Pushes variables to the variable stash with name MyStash. +#> function Push-VarStash { [CmdletBinding()] param ( diff --git a/Public/Remove-VarStash.ps1 b/Public/Remove-VarStash.ps1 index b2743a8..9775f88 100644 --- a/Public/Remove-VarStash.ps1 +++ b/Public/Remove-VarStash.ps1 @@ -1,3 +1,21 @@ +<# +.SYNOPSIS + Removes a variable stash. +.DESCRIPTION + Permanently removes a variable stash. +.EXAMPLE + Remove-VarStash -Name MyStash + + Removes the stash named MyStash. +.EXAMPLE + Remove-VarStash -Index 2 + + Removes the stash with index position 2 (lates stash has index 0). +.EXAMPLE + Remove-VarStash -Index 2 -WhatIf + + Shows what would have happened if this command would run without the -WhatIf parameter. +#> function Remove-VarStash { [CmdletBinding(DefaultParameterSetName = 'Name')] param( diff --git a/Public/Show-VarStash.ps1 b/Public/Show-VarStash.ps1 index 58ed89a..652271c 100644 --- a/Public/Show-VarStash.ps1 +++ b/Public/Show-VarStash.ps1 @@ -1,3 +1,21 @@ +<# +.SYNOPSIS + Shows the content of a variable stash. +.DESCRIPTION + Shows the content of a variable stash. Returns objects of type PSVariable. +.EXAMPLE + Show-VarStash + + Shows the content of the latest stash (from top of stash, index 0) +.EXAMPLE + Show-VarStash -Name MyStash + + Shows the content of the stash named MyStash. +.EXAMPLE + Show-VarStash -Index 2 + + Shows the content of the stash with index position 2 (lates stash has index 0). +#> function Show-VarStash { [CmdletBinding(DefaultParameterSetName = '__AllParameterSets')] param(