From e2af3fd93498398acac0b5f81b64f5ce56b6cfab Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Tue, 28 Nov 2017 23:09:28 +0900 Subject: [PATCH] Update unapproved verbs examples in Get-Verb.md * Updated Example 4 * Removed Example 5 --- .../Functions/Get-Verb.md | 36 +++--------------- .../Functions/Get-Verb.md | 36 +++--------------- .../Functions/Get-Verb.md | 36 +++--------------- .../Functions/Get-Verb.md | 36 +++--------------- .../Microsoft.PowerShell.Utility/Get-Verb.md | 38 ++++--------------- 5 files changed, 31 insertions(+), 151 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md b/reference/3.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md index 1c62ad6d1a18..c83ae9216d9a 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md @@ -84,40 +84,16 @@ Unprotect Security This command gets all approved verbs in the Security group. ### Example 4 -``` -get-command -module MyModule | where { (get-verb $_.Verb) -eq $null } +```powershell +Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb +# CommandType Name Version Source +# ----------- ---- ------- ------ +# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility +# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility ``` -Description - ------------ - This command finds all commands in a module that have unapproved verbs. -### Example 5 -``` -$approvedVerbs = get-verb | foreach {$_.verb} - -C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb} - -# Does MyModule export functions with unapproved verbs? -C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false -True - -# Which unapproved verbs are used in MyModule? -C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_}) -ForEach -Sort -Tee -Where -``` - -Description - ------------ - -These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module. - ## PARAMETERS ### -verb diff --git a/reference/4.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md b/reference/4.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md index 1c62ad6d1a18..c83ae9216d9a 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md @@ -84,40 +84,16 @@ Unprotect Security This command gets all approved verbs in the Security group. ### Example 4 -``` -get-command -module MyModule | where { (get-verb $_.Verb) -eq $null } +```powershell +Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb +# CommandType Name Version Source +# ----------- ---- ------- ------ +# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility +# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility ``` -Description - ------------ - This command finds all commands in a module that have unapproved verbs. -### Example 5 -``` -$approvedVerbs = get-verb | foreach {$_.verb} - -C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb} - -# Does MyModule export functions with unapproved verbs? -C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false -True - -# Which unapproved verbs are used in MyModule? -C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_}) -ForEach -Sort -Tee -Where -``` - -Description - ------------ - -These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module. - ## PARAMETERS ### -verb diff --git a/reference/5.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md b/reference/5.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md index 09991dac08c4..3edd28495db2 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md @@ -84,40 +84,16 @@ Unprotect Security This command gets all approved verbs in the Security group. ### Example 4 -``` -get-command -module MyModule | where { (get-verb $_.Verb) -eq $null } +```powershell +Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb +# CommandType Name Version Source +# ----------- ---- ------- ------ +# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility +# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility ``` -Description - ------------ - This command finds all commands in a module that have unapproved verbs. -### Example 5 -``` -$approvedVerbs = get-verb | foreach {$_.verb} - -C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb} - -# Does MyModule export functions with unapproved verbs? -C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false -True - -# Which unapproved verbs are used in MyModule? -C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_}) -ForEach -Sort -Tee -Where -``` - -Description - ------------ - -These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module. - ## PARAMETERS ### -verb diff --git a/reference/5.1/Microsoft.PowerShell.Core/Functions/Get-Verb.md b/reference/5.1/Microsoft.PowerShell.Core/Functions/Get-Verb.md index 09991dac08c4..3edd28495db2 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Functions/Get-Verb.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Functions/Get-Verb.md @@ -84,40 +84,16 @@ Unprotect Security This command gets all approved verbs in the Security group. ### Example 4 -``` -get-command -module MyModule | where { (get-verb $_.Verb) -eq $null } +```powershell +Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb +# CommandType Name Version Source +# ----------- ---- ------- ------ +# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility +# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility ``` -Description - ------------ - This command finds all commands in a module that have unapproved verbs. -### Example 5 -``` -$approvedVerbs = get-verb | foreach {$_.verb} - -C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb} - -# Does MyModule export functions with unapproved verbs? -C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false -True - -# Which unapproved verbs are used in MyModule? -C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_}) -ForEach -Sort -Tee -Where -``` - -Description - ------------ - -These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module. - ## PARAMETERS ### -verb diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Verb.md b/reference/6/Microsoft.PowerShell.Utility/Get-Verb.md index a7cd0ccaba41..32a6424f81f8 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Verb.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Verb.md @@ -80,41 +80,17 @@ Unprotect up Security Removes safeguards from a resource that wer... This command gets all approved verbs in the Security group. -### -------------------------- EXAMPLE 4 -------------------------- -``` -get-command -module MyModule | where { (get-verb $_.Verb) -eq $null } +### Example 4 +```powershell +Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb +# CommandType Name Version Source +# ----------- ---- ------- ------ +# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility +# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility ``` -Description - ------------ - This command finds all commands in a module that have unapproved verbs. -### -------------------------- EXAMPLE 5 -------------------------- -``` -$approvedVerbs = get-verb | foreach {$_.verb} - -C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb} - -# Does MyModule export functions with unapproved verbs? -C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false -True - -# Which unapproved verbs are used in MyModule? -C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_}) -ForEach -Sort -Tee -Where -``` - -Description - ------------ - -These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module. - ## PARAMETERS ### -verb