From 6589c7cc4f8012d34f58a3329f59b4f7f66aad0a Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 28 Feb 2024 16:29:41 -0600 Subject: [PATCH 1/2] Fix format of "Accept pipeline input" metadata (#10912) --- .../New-Item.md | 16 ++++++++-------- .../Set-Item.md | 4 ++-- .../Test-Path.md | 4 ++-- .../New-Item.md | 18 +++++++++--------- .../Set-Content.md | 8 ++++---- .../Set-Item.md | 4 ++-- .../Set-ItemProperty.md | 2 +- .../Test-Path.md | 4 ++-- .../Write-Information.md | 4 ++-- .../New-Item.md | 18 +++++++++--------- .../Set-Content.md | 8 ++++---- .../Set-Item.md | 4 ++-- .../Set-ItemProperty.md | 2 +- .../Test-Path.md | 4 ++-- .../Write-Information.md | 4 ++-- .../New-Item.md | 18 +++++++++--------- .../Set-Clipboard.md | 2 +- .../Set-Content.md | 9 ++++----- .../Set-Item.md | 4 ++-- .../Set-ItemProperty.md | 2 +- .../Start-Process.md | 2 +- .../Test-Path.md | 4 ++-- .../Write-Information.md | 4 ++-- .../New-Item.md | 18 +++++++++--------- .../Set-Clipboard.md | 2 +- .../Set-Content.md | 9 ++++----- .../Set-Item.md | 4 ++-- .../Set-ItemProperty.md | 2 +- .../Start-Process.md | 2 +- .../Test-Path.md | 4 ++-- .../Write-Information.md | 4 ++-- 31 files changed, 96 insertions(+), 98 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-Item.md b/reference/5.1/Microsoft.PowerShell.Management/New-Item.md index 5dd823b1cd1d..502be1ca9a79 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-Item.md @@ -264,7 +264,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -285,7 +285,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -307,7 +307,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -328,7 +328,7 @@ Aliases: Required: True Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -452,7 +452,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -473,7 +473,7 @@ Aliases: OS Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -518,7 +518,7 @@ Aliases: Required: False False Position: Named Default value: None -Accept pipeline input: ByValue (System.Object[]), ByName (System.Object[]) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -539,7 +539,7 @@ Aliases: SO Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Set-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Set-Item.md index 244380aed9a7..841717aa4598 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Set-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Set-Item.md @@ -251,7 +251,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -315,7 +315,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md index 1495c67c8c7b..143ff8236984 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md @@ -356,7 +356,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -387,7 +387,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.2/Microsoft.PowerShell.Management/New-Item.md b/reference/7.2/Microsoft.PowerShell.Management/New-Item.md index 1358700034fd..ccc2c79b6313 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.2/Microsoft.PowerShell.Management/New-Item.md @@ -264,7 +264,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -285,7 +285,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -307,7 +307,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -328,7 +328,7 @@ Aliases: Required: True Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -454,7 +454,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -475,7 +475,7 @@ Aliases: OS Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -520,7 +520,7 @@ Aliases: Required: False False Position: Named Default value: None -Accept pipeline input: ByValue (System.Object[]), ByName (System.Object[]) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -541,7 +541,7 @@ Aliases: SO Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -563,7 +563,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.2/Microsoft.PowerShell.Management/Set-Content.md b/reference/7.2/Microsoft.PowerShell.Management/Set-Content.md index 4c4e5ef4bd92..51d8d952565c 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Set-Content.md @@ -182,7 +182,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -246,7 +246,7 @@ Accepted values: ASCII, BigEndianUnicode, BigEndianUTF32, OEM, Unicode, UTF7, UT Required: False Position: Named Default value: utf8NoBOM -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -369,7 +369,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -434,7 +434,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.2/Microsoft.PowerShell.Management/Set-Item.md b/reference/7.2/Microsoft.PowerShell.Management/Set-Item.md index 50fce1fa327c..6da5fc0d0fd2 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Set-Item.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Set-Item.md @@ -251,7 +251,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -315,7 +315,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.2/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.2/Microsoft.PowerShell.Management/Set-ItemProperty.md index c17f51ec112d..e45143e05cd1 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -389,7 +389,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.2/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.2/Microsoft.PowerShell.Management/Test-Path.md index a839196bdb8d..a102c2726cfc 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Test-Path.md @@ -349,7 +349,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -380,7 +380,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Write-Information.md b/reference/7.2/Microsoft.PowerShell.Utility/Write-Information.md index a58f104b71c2..82c9869f7034 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Write-Information.md @@ -194,7 +194,7 @@ Aliases: Msg, Message Required: True Position: 0 Default value: None -Accept pipeline input: ByValue (True), ByName (False) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -212,7 +212,7 @@ Aliases: Required: False Position: 1 Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.3/Microsoft.PowerShell.Management/New-Item.md b/reference/7.3/Microsoft.PowerShell.Management/New-Item.md index 3d6ea04bbe5e..3c66c12d62c2 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.3/Microsoft.PowerShell.Management/New-Item.md @@ -264,7 +264,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -285,7 +285,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -307,7 +307,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -328,7 +328,7 @@ Aliases: Required: True Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -454,7 +454,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -475,7 +475,7 @@ Aliases: OS Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -520,7 +520,7 @@ Aliases: Required: False False Position: Named Default value: None -Accept pipeline input: ByValue (System.Object[]), ByName (System.Object[]) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -541,7 +541,7 @@ Aliases: SO Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -563,7 +563,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.3/Microsoft.PowerShell.Management/Set-Content.md b/reference/7.3/Microsoft.PowerShell.Management/Set-Content.md index f7833d264e8d..2cc623c56514 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Set-Content.md @@ -182,7 +182,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -246,7 +246,7 @@ Accepted values: ASCII, BigEndianUnicode, BigEndianUTF32, OEM, Unicode, UTF7, UT Required: False Position: Named Default value: utf8NoBOM -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -369,7 +369,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -434,7 +434,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.3/Microsoft.PowerShell.Management/Set-Item.md b/reference/7.3/Microsoft.PowerShell.Management/Set-Item.md index a40ddade8928..fbf369c3f890 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Set-Item.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Set-Item.md @@ -251,7 +251,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -315,7 +315,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.3/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.3/Microsoft.PowerShell.Management/Set-ItemProperty.md index 05d56b7afbe6..b0542b00ba4f 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -389,7 +389,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.3/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.3/Microsoft.PowerShell.Management/Test-Path.md index 75f271b5eed1..3c595fee652e 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Test-Path.md @@ -349,7 +349,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -380,7 +380,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Write-Information.md b/reference/7.3/Microsoft.PowerShell.Utility/Write-Information.md index be787551f863..cbd7ecaa8020 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Write-Information.md @@ -194,7 +194,7 @@ Aliases: Msg, Message Required: True Position: 0 Default value: None -Accept pipeline input: ByValue (True), ByName (False) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -212,7 +212,7 @@ Aliases: Required: False Position: 1 Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/New-Item.md b/reference/7.4/Microsoft.PowerShell.Management/New-Item.md index 1b1966c43e50..45edda4ec02a 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/New-Item.md @@ -264,7 +264,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -285,7 +285,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -307,7 +307,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -328,7 +328,7 @@ Aliases: Required: True Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -453,7 +453,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -474,7 +474,7 @@ Aliases: OS Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -519,7 +519,7 @@ Aliases: Required: False False Position: Named Default value: None -Accept pipeline input: ByValue (System.Object[]), ByName (System.Object[]) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -540,7 +540,7 @@ Aliases: SO Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -562,7 +562,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md index e63473d7cf68..9a7e714e8c93 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -108,7 +108,7 @@ Aliases: ToLocalhost Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Content.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Content.md index 395dcd85ba4b..30c356befde7 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Content.md @@ -182,7 +182,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -251,7 +251,7 @@ Accepted values: ASCII, BigEndianUnicode, BigEndianUTF32, OEM, Unicode, UTF7, UT Required: False Position: Named Default value: utf8NoBOM -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -374,7 +374,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -439,7 +439,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -516,7 +516,6 @@ When you use the **PassThru** parameter, this cmdlet returns a string representi ## NOTES - - `Set-Content` is designed for string processing. If you pipe non-string objects to `Set-Content`, it converts the object to a string before writing it. To write objects to files, use `Out-File`. - The `Set-Content` cmdlet is designed to work with the data exposed by any provider. To list the diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Item.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Item.md index c475767b20fc..d7acf9310c9d 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Item.md @@ -251,7 +251,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -315,7 +315,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md index f772b747aa44..89aa569baa6a 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -389,7 +389,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md b/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md index 34953552316a..ff6c31e21408 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md @@ -261,7 +261,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md index 39a2191a0109..13da9637ee35 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md @@ -349,7 +349,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -380,7 +380,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md b/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md index a73151bcce16..cad2842eae99 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md @@ -194,7 +194,7 @@ Aliases: Msg, Message Required: True Position: 0 Default value: None -Accept pipeline input: ByValue (True), ByName (False) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -212,7 +212,7 @@ Aliases: Required: False Position: 1 Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md index a36128441fab..d2fa8325458f 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md @@ -264,7 +264,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -285,7 +285,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -307,7 +307,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -328,7 +328,7 @@ Aliases: Required: True Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -453,7 +453,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -474,7 +474,7 @@ Aliases: OS Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -519,7 +519,7 @@ Aliases: Required: False False Position: Named Default value: None -Accept pipeline input: ByValue (System.Object[]), ByName (System.Object[]) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -540,7 +540,7 @@ Aliases: SO Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -562,7 +562,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md index 934c60b73182..ee4387af9c0a 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -108,7 +108,7 @@ Aliases: ToLocalhost Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Content.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Content.md index 9aa40aa12bd8..986d07a576b6 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Content.md @@ -182,7 +182,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -251,7 +251,7 @@ Accepted values: ASCII, BigEndianUnicode, BigEndianUTF32, OEM, Unicode, UTF7, UT Required: False Position: Named Default value: utf8NoBOM -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -374,7 +374,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -439,7 +439,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -516,7 +516,6 @@ When you use the **PassThru** parameter, this cmdlet returns a string representi ## NOTES - - `Set-Content` is designed for string processing. If you pipe non-string objects to `Set-Content`, it converts the object to a string before writing it. To write objects to files, use `Out-File`. - The `Set-Content` cmdlet is designed to work with the data exposed by any provider. To list the diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md index e36f8184e029..fdc05685d805 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md @@ -251,7 +251,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -315,7 +315,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md index 816a48a78425..459584a6c74a 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -389,7 +389,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (True) +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md index 3d66f578602e..e72ccc313c40 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md @@ -261,7 +261,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md index 459a6798e794..aab0a86f65d0 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md @@ -351,7 +351,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -382,7 +382,7 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md b/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md index f6341a51e3aa..9a70fe5288c1 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md @@ -194,7 +194,7 @@ Aliases: Msg, Message Required: True Position: 0 Default value: None -Accept pipeline input: ByValue (True), ByName (False) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -212,7 +212,7 @@ Aliases: Required: False Position: 1 Default value: None -Accept pipeline input: ByValue (False), ByName (False) +Accept pipeline input: False Accept wildcard characters: False ``` From 7d0a67ee9af639b46ee85036be1247dff4c61390 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 28 Feb 2024 16:57:21 -0600 Subject: [PATCH 2/2] Fixes #10911 - Add example using an expression (#10913) * Add example using an expression * Improved the example --- .../About/about_Switch.md | 22 ++++++++++++++++++- .../About/about_Switch.md | 22 ++++++++++++++++++- .../About/about_Switch.md | 22 ++++++++++++++++++- .../About/about_Switch.md | 22 ++++++++++++++++++- .../About/about_Switch.md | 22 ++++++++++++++++++- 5 files changed, 105 insertions(+), 5 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md index 886e88f96564..276e60de9adf 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,7 +1,7 @@ --- description: Explains how to use a switch to handle multiple `if` statements. Locale: en-US -ms.date: 01/27/2022 +ms.date: 02/28/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Switch @@ -223,6 +223,26 @@ switch (4, 2) It is four. ``` +In this example, the `switch` statement is testing for the type of the value in +the hashtable. You must use and expression that returns a boolean value to +select the scriptblock to execute. + +```powershell +$var = @{A = 10; B = 'abc'} + +foreach ($key in $var.Keys) { + switch ($var[$key].GetType()) { + { $_ -eq [int32] } { "$key + 10 = $($var[$key] + 10)" } + { $_ -eq [string] } { "$key = $($var[$key])" } + } +} +``` + +```Output +A + 10 = 20 +B = abc +``` + In this example, an object that's not a string or numerical data is passed to the `switch`. The `switch` performs a string coercion on the object and evaluates the outcome. diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Switch.md index e0c715deffa1..4634a6801f6c 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,7 +1,7 @@ --- description: Explains how to use a switch to handle multiple `if` statements. Locale: en-US -ms.date: 01/27/2022 +ms.date: 02/28/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Switch @@ -223,6 +223,26 @@ switch (4, 2) It is four. ``` +In this example, the `switch` statement is testing for the type of the value in +the hashtable. You must use and expression that returns a boolean value to +select the scriptblock to execute. + +```powershell +$var = @{A = 10; B = 'abc'} + +foreach ($key in $var.Keys) { + switch ($var[$key].GetType()) { + { $_ -eq [int32] } { "$key + 10 = $($var[$key] + 10)" } + { $_ -eq [string] } { "$key = $($var[$key])" } + } +} +``` + +```Output +A + 10 = 20 +B = abc +``` + In this example, an object that's not a string or numerical data is passed to the `switch`. The `switch` performs a string coercion on the object and evaluates the outcome. diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Switch.md index b0139c16c107..4e529dd338c2 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,7 +1,7 @@ --- description: Explains how to use a switch to handle multiple `if` statements. Locale: en-US -ms.date: 01/27/2022 +ms.date: 02/28/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Switch @@ -223,6 +223,26 @@ switch (4, 2) It is four. ``` +In this example, the `switch` statement is testing for the type of the value in +the hashtable. You must use and expression that returns a boolean value to +select the scriptblock to execute. + +```powershell +$var = @{A = 10; B = 'abc'} + +foreach ($key in $var.Keys) { + switch ($var[$key].GetType()) { + { $_ -eq [int32] } { "$key + 10 = $($var[$key] + 10)" } + { $_ -eq [string] } { "$key = $($var[$key])" } + } +} +``` + +```Output +A + 10 = 20 +B = abc +``` + In this example, an object that's not a string or numerical data is passed to the `switch`. The `switch` performs a string coercion on the object and evaluates the outcome. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md index 48f98a056292..e441d012c759 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,7 +1,7 @@ --- description: Explains how to use a switch to handle multiple `if` statements. Locale: en-US -ms.date: 01/27/2022 +ms.date: 02/28/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Switch @@ -223,6 +223,26 @@ switch (4, 2) It is four. ``` +In this example, the `switch` statement is testing for the type of the value in +the hashtable. You must use and expression that returns a boolean value to +select the scriptblock to execute. + +```powershell +$var = @{A = 10; B = 'abc'} + +foreach ($key in $var.Keys) { + switch ($var[$key].GetType()) { + { $_ -eq [int32] } { "$key + 10 = $($var[$key] + 10)" } + { $_ -eq [string] } { "$key = $($var[$key])" } + } +} +``` + +```Output +A + 10 = 20 +B = abc +``` + In this example, an object that's not a string or numerical data is passed to the `switch`. The `switch` performs a string coercion on the object and evaluates the outcome. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md index f93e88d67859..ab1d949852c3 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,7 +1,7 @@ --- description: Explains how to use a switch to handle multiple `if` statements. Locale: en-US -ms.date: 01/27/2022 +ms.date: 02/28/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Switch @@ -223,6 +223,26 @@ switch (4, 2) It is four. ``` +In this example, the `switch` statement is testing for the type of the value in +the hashtable. You must use and expression that returns a boolean value to +select the scriptblock to execute. + +```powershell +$var = @{A = 10; B = 'abc'} + +foreach ($key in $var.Keys) { + switch ($var[$key].GetType()) { + { $_ -eq [int32] } { "$key + 10 = $($var[$key] + 10)" } + { $_ -eq [string] } { "$key = $($var[$key])" } + } +} +``` + +```Output +A + 10 = 20 +B = abc +``` + In this example, an object that's not a string or numerical data is passed to the `switch`. The `switch` performs a string coercion on the object and evaluates the outcome.