From 6abadc41459de9da3d6d3217065eb1e00be8d531 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 29 Jan 2024 10:07:03 -0600 Subject: [PATCH] Fix typo and add multi-splat example (#10836) --- .../About/about_Splatting.md | 60 ++++++++++++++----- .../New-Item.md | 4 +- .../About/about_Splatting.md | 60 ++++++++++++++----- .../New-Item.md | 4 +- .../About/about_Splatting.md | 60 ++++++++++++++----- .../New-Item.md | 4 +- .../About/about_Splatting.md | 60 ++++++++++++++----- .../New-Item.md | 4 +- .../About/about_Splatting.md | 60 ++++++++++++++----- .../New-Item.md | 4 +- 10 files changed, 230 insertions(+), 90 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md index 425481ea9e98..6988fdcde102 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,7 +1,7 @@ --- description: Describes how to use splatting to pass parameters to commands in PowerShell. Locale: en-US -ms.date: 12/12/2022 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Splatting @@ -231,6 +231,26 @@ b = 2 c = 3 ``` +### Example 3: Using multiple splatted objects in a single command + +You can use multiple splatted objects in a single command. In this example, +different parameters are defined in separate hashtables. The hashtables are +splatted in a single `Write-Host` command. + +```powershell +$a = @{ + Message = 'Hello', 'World!' +} +$b = @{ + Separator = '|' +} +$c = @{ + BackgroundColor = 'Cyan' + ForegroundColor = 'Black' +} +Write-Host @a @b @c +``` + ## Splatting command parameters You can use splatting to represent the parameters of a command. This technique @@ -290,13 +310,15 @@ Get-MyCommand -P -C -Name PowerShell ``` ```Output -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -408 28 75568 83176 620 1.33 1692 powershell +Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName +------- ------ ----- ----- ------ -- -- ----------- + 830 50 115840 95524 16.75 6880 1 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Source : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Version : 10.0.22621.3085 Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -307,14 +329,13 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell - \v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616 + FileVersion: 10.0.22621.1 (WinBuild.160101.0800) FileDescription: Windows PowerShell - Product: Microsoft Windows Operating System - ProductVersion: 10.0.14393.0 + Product: Microsoft® Windows® Operating System + ProductVersion: 10.0.22621.1 Debug: False Patched: False PreRelease: False @@ -332,11 +353,18 @@ parameter definition. PowerShell Desired State Configuration (DSC) was not designed to use splatting. You cannot use splatting to pass values into a DSC resource. For more -information, see Gael Colas' article [Pseudo-Splatting DSC Resources](https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/). +information, see Gael Colas' article [Pseudo-Splatting DSC Resources][05]. ## See also -- [about_Arrays](about_Arrays.md) -- [about_Automatic_Variables](about_Automatic_Variables.md) -- [about_Hash_Tables](about_Hash_Tables.md) -- [about_Parameters](about_Parameters.md) +- [about_Arrays][01] +- [about_Automatic_Variables][02] +- [about_Hash_Tables][03] +- [about_Parameters][04] + + +[01]: about_Arrays.md +[02]: about_Automatic_Variables.md +[03]: about_Hash_Tables.md +[04]: about_Parameters.md +[05]: https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/ diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-Item.md b/reference/5.1/Microsoft.PowerShell.Management/New-Item.md index fa30925bd44c..e04bafa32a97 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/30/2023 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-item?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Item @@ -221,7 +221,7 @@ Mode LastWriteTime Length Name ### Example 9: Use the -Force parameter to overwrite existing files This example creates a file with a value and then recreates the file using `-Force`. This overwrites -The existing file and it will lose it's content as you can see by the length property +the existing file, as you can see by the length property. ```powershell PS> New-Item ./TestFile.txt -ItemType File -Value 'This is just a test file' diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Splatting.md index 85f0788ecc03..13c5e0690b4d 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,7 +1,7 @@ --- description: Describes how to use splatting to pass parameters to commands in PowerShell. Locale: en-US -ms.date: 12/12/2022 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Splatting @@ -274,6 +274,26 @@ foreach ($vm in $allVms) } ``` +### Example 4: Using multiple splatted objects in a single command + +You can use multiple splatted objects in a single command. In this example, +different parameters are defined in separate hashtables. The hashtables are +splatted in a single `Write-Host` command. + +```powershell +$a = @{ + Message = 'Hello', 'World!' +} +$b = @{ + Separator = '|' +} +$c = @{ + BackgroundColor = 'Cyan' + ForegroundColor = 'Black' +} +Write-Host @a @b @c +``` + ## Splatting command parameters You can use splatting to represent the parameters of a command. This technique @@ -333,13 +353,15 @@ Get-MyCommand -P -C -Name PowerShell ``` ```Output -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -408 28 75568 83176 620 1.33 1692 powershell + NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName + ------ ----- ----- ------ -- -- ----------- + 50 112.76 78.52 16.64 6880 1 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Source : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Version : 10.0.22621.3085 Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -350,14 +372,13 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell - \v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616 + FileVersion: 10.0.22621.1 (WinBuild.160101.0800) FileDescription: Windows PowerShell - Product: Microsoft Windows Operating System - ProductVersion: 10.0.14393.0 + Product: Microsoft® Windows® Operating System + ProductVersion: 10.0.22621.1 Debug: False Patched: False PreRelease: False @@ -375,11 +396,18 @@ parameter definition. PowerShell Desired State Configuration (DSC) was not designed to use splatting. You cannot use splatting to pass values into a DSC resource. For more -information, see Gael Colas' article [Pseudo-Splatting DSC Resources](https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/). +information, see Gael Colas' article [Pseudo-Splatting DSC Resources][05]. ## See also -- [about_Arrays](about_Arrays.md) -- [about_Automatic_Variables](about_Automatic_Variables.md) -- [about_Hash_Tables](about_Hash_Tables.md) -- [about_Parameters](about_Parameters.md) +- [about_Arrays][01] +- [about_Automatic_Variables][02] +- [about_Hash_Tables][03] +- [about_Parameters][04] + + +[01]: about_Arrays.md +[02]: about_Automatic_Variables.md +[03]: about_Hash_Tables.md +[04]: about_Parameters.md +[05]: https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/ diff --git a/reference/7.2/Microsoft.PowerShell.Management/New-Item.md b/reference/7.2/Microsoft.PowerShell.Management/New-Item.md index c12592368f44..069e99776ad7 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.2/Microsoft.PowerShell.Management/New-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/30/2023 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Item @@ -221,7 +221,7 @@ Mode LastWriteTime Length Name ### Example 9: Use the -Force parameter to overwrite existing files This example creates a file with a value and then recreates the file using `-Force`. This overwrites -The existing file and it will lose it's content as you can see by the length property +the existing file, as you can see by the length property. ```powershell PS> New-Item ./TestFile.txt -ItemType File -Value 'This is just a test file' diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Splatting.md index f93049d88418..a12b7da78eff 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,7 +1,7 @@ --- description: Describes how to use splatting to pass parameters to commands in PowerShell. Locale: en-US -ms.date: 12/12/2022 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Splatting @@ -274,6 +274,26 @@ foreach ($vm in $allVms) } ``` +### Example 4: Using multiple splatted objects in a single command + +You can use multiple splatted objects in a single command. In this example, +different parameters are defined in separate hashtables. The hashtables are +splatted in a single `Write-Host` command. + +```powershell +$a = @{ + Message = 'Hello', 'World!' +} +$b = @{ + Separator = '|' +} +$c = @{ + BackgroundColor = 'Cyan' + ForegroundColor = 'Black' +} +Write-Host @a @b @c +``` + ## Splatting command parameters You can use splatting to represent the parameters of a command. This technique @@ -333,13 +353,15 @@ Get-MyCommand -P -C -Name PowerShell ``` ```Output -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -408 28 75568 83176 620 1.33 1692 powershell + NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName + ------ ----- ----- ------ -- -- ----------- + 50 112.76 78.52 16.64 6880 1 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Source : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Version : 10.0.22621.3085 Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -350,14 +372,13 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell - \v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616 + FileVersion: 10.0.22621.1 (WinBuild.160101.0800) FileDescription: Windows PowerShell - Product: Microsoft Windows Operating System - ProductVersion: 10.0.14393.0 + Product: Microsoft® Windows® Operating System + ProductVersion: 10.0.22621.1 Debug: False Patched: False PreRelease: False @@ -375,11 +396,18 @@ parameter definition. PowerShell Desired State Configuration (DSC) was not designed to use splatting. You cannot use splatting to pass values into a DSC resource. For more -information, see Gael Colas' article [Pseudo-Splatting DSC Resources](https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/). +information, see Gael Colas' article [Pseudo-Splatting DSC Resources][05]. ## See also -- [about_Arrays](about_Arrays.md) -- [about_Automatic_Variables](about_Automatic_Variables.md) -- [about_Hash_Tables](about_Hash_Tables.md) -- [about_Parameters](about_Parameters.md) +- [about_Arrays][01] +- [about_Automatic_Variables][02] +- [about_Hash_Tables][03] +- [about_Parameters][04] + + +[01]: about_Arrays.md +[02]: about_Automatic_Variables.md +[03]: about_Hash_Tables.md +[04]: about_Parameters.md +[05]: https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/ diff --git a/reference/7.3/Microsoft.PowerShell.Management/New-Item.md b/reference/7.3/Microsoft.PowerShell.Management/New-Item.md index 42e39ed86186..ad5d10d4677e 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.3/Microsoft.PowerShell.Management/New-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/30/2023 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Item @@ -221,7 +221,7 @@ Mode LastWriteTime Length Name ### Example 9: Use the -Force parameter to overwrite existing files This example creates a file with a value and then recreates the file using `-Force`. This overwrites -The existing file and it will lose it's content as you can see by the length property +the existing file, as you can see by the length property. ```powershell PS> New-Item ./TestFile.txt -ItemType File -Value 'This is just a test file' diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md index e024b96bee9f..a3e01c9aa721 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,7 +1,7 @@ --- description: Describes how to use splatting to pass parameters to commands in PowerShell. Locale: en-US -ms.date: 12/12/2022 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Splatting @@ -274,6 +274,26 @@ foreach ($vm in $allVms) } ``` +### Example 4: Using multiple splatted objects in a single command + +You can use multiple splatted objects in a single command. In this example, +different parameters are defined in separate hashtables. The hashtables are +splatted in a single `Write-Host` command. + +```powershell +$a = @{ + Message = 'Hello', 'World!' +} +$b = @{ + Separator = '|' +} +$c = @{ + BackgroundColor = 'Cyan' + ForegroundColor = 'Black' +} +Write-Host @a @b @c +``` + ## Splatting command parameters You can use splatting to represent the parameters of a command. This technique @@ -333,13 +353,15 @@ Get-MyCommand -P -C -Name PowerShell ``` ```Output -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -408 28 75568 83176 620 1.33 1692 powershell + NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName + ------ ----- ----- ------ -- -- ----------- + 50 112.76 78.52 16.64 6880 1 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Source : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Version : 10.0.22621.3085 Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -350,14 +372,13 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell - \v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616 + FileVersion: 10.0.22621.1 (WinBuild.160101.0800) FileDescription: Windows PowerShell - Product: Microsoft Windows Operating System - ProductVersion: 10.0.14393.0 + Product: Microsoft® Windows® Operating System + ProductVersion: 10.0.22621.1 Debug: False Patched: False PreRelease: False @@ -375,11 +396,18 @@ parameter definition. PowerShell Desired State Configuration (DSC) was not designed to use splatting. You cannot use splatting to pass values into a DSC resource. For more -information, see Gael Colas' article [Pseudo-Splatting DSC Resources](https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/). +information, see Gael Colas' article [Pseudo-Splatting DSC Resources][05]. ## See also -- [about_Arrays](about_Arrays.md) -- [about_Automatic_Variables](about_Automatic_Variables.md) -- [about_Hash_Tables](about_Hash_Tables.md) -- [about_Parameters](about_Parameters.md) +- [about_Arrays][01] +- [about_Automatic_Variables][02] +- [about_Hash_Tables][03] +- [about_Parameters][04] + + +[01]: about_Arrays.md +[02]: about_Automatic_Variables.md +[03]: about_Hash_Tables.md +[04]: about_Parameters.md +[05]: https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/ diff --git a/reference/7.4/Microsoft.PowerShell.Management/New-Item.md b/reference/7.4/Microsoft.PowerShell.Management/New-Item.md index 3b29a5cdf516..b09dd43f9736 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/New-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/30/2023 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Item @@ -221,7 +221,7 @@ Mode LastWriteTime Length Name ### Example 9: Use the -Force parameter to overwrite existing files This example creates a file with a value and then recreates the file using `-Force`. This overwrites -The existing file and it will lose it's content as you can see by the length property +the existing file, as you can see by the length property. ```powershell PS> New-Item ./TestFile.txt -ItemType File -Value 'This is just a test file' diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md index 61e40788dbbb..c641731f9e4b 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,7 +1,7 @@ --- description: Describes how to use splatting to pass parameters to commands in PowerShell. Locale: en-US -ms.date: 12/12/2022 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Splatting @@ -274,6 +274,26 @@ foreach ($vm in $allVms) } ``` +### Example 4: Using multiple splatted objects in a single command + +You can use multiple splatted objects in a single command. In this example, +different parameters are defined in separate hashtables. The hashtables are +splatted in a single `Write-Host` command. + +```powershell +$a = @{ + Message = 'Hello', 'World!' +} +$b = @{ + Separator = '|' +} +$c = @{ + BackgroundColor = 'Cyan' + ForegroundColor = 'Black' +} +Write-Host @a @b @c +``` + ## Splatting command parameters You can use splatting to represent the parameters of a command. This technique @@ -333,13 +353,15 @@ Get-MyCommand -P -C -Name PowerShell ``` ```Output -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -408 28 75568 83176 620 1.33 1692 powershell + NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName + ------ ----- ----- ------ -- -- ----------- + 50 112.76 78.52 16.64 6880 1 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Source : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Version : 10.0.22621.3085 Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -350,14 +372,13 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell - \v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616 + FileVersion: 10.0.22621.1 (WinBuild.160101.0800) FileDescription: Windows PowerShell - Product: Microsoft Windows Operating System - ProductVersion: 10.0.14393.0 + Product: Microsoft® Windows® Operating System + ProductVersion: 10.0.22621.1 Debug: False Patched: False PreRelease: False @@ -375,11 +396,18 @@ parameter definition. PowerShell Desired State Configuration (DSC) was not designed to use splatting. You cannot use splatting to pass values into a DSC resource. For more -information, see Gael Colas' article [Pseudo-Splatting DSC Resources](https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/). +information, see Gael Colas' article [Pseudo-Splatting DSC Resources][05]. ## See also -- [about_Arrays](about_Arrays.md) -- [about_Automatic_Variables](about_Automatic_Variables.md) -- [about_Hash_Tables](about_Hash_Tables.md) -- [about_Parameters](about_Parameters.md) +- [about_Arrays][01] +- [about_Automatic_Variables][02] +- [about_Hash_Tables][03] +- [about_Parameters][04] + + +[01]: about_Arrays.md +[02]: about_Automatic_Variables.md +[03]: about_Hash_Tables.md +[04]: about_Parameters.md +[05]: https://gaelcolas.com/2017/11/05/pseudo-splatting-dsc-resources/ diff --git a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md index 4cd5aae1a79e..43e120e74dea 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/30/2023 +ms.date: 01/29/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-Item @@ -221,7 +221,7 @@ Mode LastWriteTime Length Name ### Example 9: Use the -Force parameter to overwrite existing files This example creates a file with a value and then recreates the file using `-Force`. This overwrites -The existing file and it will lose it's content as you can see by the length property +the existing file, as you can see by the length property. ```powershell PS> New-Item ./TestFile.txt -ItemType File -Value 'This is just a test file'