Updates from: 06/05/2021 03:17:28
Service Microsoft Docs article Related commit history on GitHub Change details
Microsoft.PowerShell.Core About Redirection (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Redirection.md
encoding. If the file has a different encoding, the output might not be
formatted correctly. To write to files with a different encoding, use the `Out-File` cmdlet with its `Encoding` parameter.
+### Width of output when writing to a file
+
+When you are writing to a file using either `Out-File` or the redirection
+operators, PowerShell formats table output to the file based on the width of
+the console it is running within. For instance, when logging table output
+to file using a command like `Get-ChildItem Env:\Path > path.log` on a system
+where the console width is set to 80 columns, the output in the file is
+truncated to 80 characters:
+
+```Output
+Name Value
+---- -----
+Path C:\Program Files\PowerShell\7-preview;C:\WINDOWS…
+```
+
+Considering that the console width may be set arbitrarily on systems where
+your script is run, you may prefer that PowerShell format table output to
+files based on a width that you specify instead.
+
+The `Out-File` cmdlet provides a **Width** parameter that allows you to set
+the width you would like for table output. Rather than having to add
+`-Width 2000` everywhere you invoke `Out-File`, you can use the
+`$PSDefaultParameterValues` variable to set this value for all usages of the
+`Out-File` cmdlet in a script. And since the redirection operators (`>` and
+`>>`) are effectively aliases for `Out-File`, setting the `Out-File:Width`
+parameter for the whole script impacts the formatting width for the
+redirection operators as well. Put the following command near the top of your
+script to set `Out-File:Width` for the whole script:
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+```
+
+Increasing the output width will increase memory consumption when logging
+table formatted output. If you are logging a lot of tabular data to file and
+you know you can get by with a smaller width, use the smaller width.
+
+In some cases, such as `Get-Service` output, in order to use the extra width
+you will need to pipe the output through `Format-Table -AutoSize` before
+outputting to file.
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+Get-Service | Format-Table -AutoSize > services.log
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](about_preference_variables.md#psdefaultparametervalues).
+ ### Potential confusion with comparison operators The `>` operator is not to be confused with the
Microsoft.PowerShell.Utility Out File (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md
provider `Alias:`. The `Get-Location` cmdlet displays the complete path for `Ali
**C:\TestDir\AliasNames.txt**. The `Get-Content` cmdlet uses the **Path** parameter and displays the file's content in the PowerShell console.
+### Example 5: Set file output width for entire scope
+
+This example uses `$PSDefaultParameterValues` to set the `Width` parameter for all invocations of
+`Out-File` and the redirection operartors (`>` and `>>`) to 2000. This is an easy way to ensure
+that everywhere in a scope you output table formatted data to file, PowerShell will use a line
+width of 2000 instead of a line width determined by the PowerShell host's console width.
+
+```powershell
+function DemoDefaultOutFileWidth() {
+ try {
+ $PSDefaultParameterValues['out-file:width'] = 2000
+
+ $logFile = "$pwd\logfile.txt"
+
+ Get-ChildItem Env:\ > $logFile
+
+ Get-Service -ErrorAction Ignore | Format-Table -AutoSize | Out-File $logFile -Append
+
+ Get-Process | Format-Table Id,SI,Name,Path,MainWindowTitle >> $logFile
+ }
+ finally {
+ $PSDefaultParameterValues.Remove('out-file:width')
+ }
+}
+
+DemoDefaultOutFileWidth
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](../Microsoft.Powershell.Core/About/about_preference_variables.md#psdefaultparametervalues).
+ ## PARAMETERS ### -Append
Accept wildcard characters: False
Specifies the number of characters in each line of output. Any additional characters are truncated, not wrapped. If this parameter is not used, the width is determined by the characteristics of the
-host. The default for the PowerShell console is 80 characters.
+host. The default for the PowerShell console is 80 characters. If you want to control the width for
+all invocations of `Out-File` as well as the redirection operators (`>` and `>>`), set
+`$PSDefaultParameterValues['out-file:width'] = 2000` before using `Out-File`.
```yaml Type: System.Int32
PackageManagement Uninstall Package (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/PackageManagement/Uninstall-Package.md
external help file: Microsoft.PowerShell.PackageManagement.dll-Help.xml Locale: en-US Module Name: PackageManagement Previously updated : 05/18/2021
-online version: https://docs.microsoft.com/powershell/module/packagemanagement/uninstall-package?view=powershell-7.1&WT.mc_id=ps-gethelp
Last updated : 06/04/2021
+online version: https://docs.microsoft.com/powershell/module/packagemanagement/uninstall-package?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0 Title: Uninstall-Package --- # Uninstall-Package
-## SYNOPSIS
+## Synopsis
Uninstalls one or more software packages.
-## SYNTAX
+## Syntax
### PackageByInputObject
Uninstall-Package [-AllVersions] [-Force] [-ForceBootstrap] [-WhatIf] [-Confirm]
[-InstallUpdate] [-NoPathUpdate] [-AllowPrereleaseVersions] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Uninstall-Package` cmdlet uninstalls one or more software packages from the local computer. To find installed packages, use the `Get-Package` cmdlet.
-## EXAMPLES
+## Examples
### Example 1: Uninstall a package
PS> Uninstall-Package -Name NuGet.Core
### Example 2: Use the pipeline to uninstall a package `Get-Package` locates a specific package and sends the **SoftwareIdentity** object down the pipeline
-to the `Uninsall-Package` cmdlet.
+to the `Uninstall-Package` cmdlet.
``` PS> Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 | Uninstall-Package
parameter:
`Uninstall-Package -InputObject ( Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 )`
-## PARAMETERS
+## Parameters
### -AllowClobber
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### SoftwareIdentity `Uninstall-Package` accepts **SoftwareIdentity** objects from the pipeline as input.
-## OUTPUTS
+## Outputs
### SoftwareIdentity `Uninstall-Package` returns a **SoftwareIdentity** object for each package uninstalled.
-## NOTES
+## Notes
Including a package provider in a command can make dynamic parameters available to a cmdlet. Dynamic parameters are specific to a package provider. The `Get-Help` cmdlet lists a cmdlet's parameter sets
and includes the provider's parameter set. For example, `Uninstall-Package` has
**PowerShellGet** parameter set that includes `-NoPathUpdate`, `AllowClobber`, and `SkipPublisherCheck`.
-## RELATED LINKS
+## Related Links
[about_PackageManagement](../Microsoft.PowerShell.Core/About/about_PackageManagement.md)
Microsoft.PowerShell.Core About Redirection (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Redirection.md
encoding. If the file has a different encoding, the output might not be
formatted correctly. To write to files with a different encoding, use the `Out-File` cmdlet with its `Encoding` parameter.
+### Width of output when writing to a file
+
+When you are writing to a file using either `Out-File` or the redirection
+operators, PowerShell formats table output to the file based on the width of
+the console it is running within. For instance, when logging table output
+to file using a command like `Get-ChildItem Env:\Path > path.log` on a system
+where the console width is set to 80 columns, the output in the file is
+truncated to 80 characters:
+
+```Output
+Name Value
+---- -----
+Path C:\Program Files\PowerShell\7-preview;C:\WINDOWS…
+```
+
+Considering that the console width may be set arbitrarily on systems where
+your script is run, you may prefer that PowerShell format table output to
+files based on a width that you specify instead.
+
+The `Out-File` cmdlet provides a **Width** parameter that allows you to set
+the width you would like for table output. Rather than having to add
+`-Width 2000` everywhere you invoke `Out-File`, you can use the
+`$PSDefaultParameterValues` variable to set this value for all usages of the
+`Out-File` cmdlet in a script. And since the redirection operators (`>` and
+`>>`) are effectively aliases for `Out-File`, setting the `Out-File:Width`
+parameter for the whole script impacts the formatting width for the
+redirection operators as well. Put the following command near the top of your
+script to set `Out-File:Width` for the whole script:
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+```
+
+Increasing the output width will increase memory consumption when logging
+table formatted output. If you are logging a lot of tabular data to file and
+you know you can get by with a smaller width, use the smaller width.
+
+In some cases, such as `Get-Service` output, in order to use the extra width
+you will need to pipe the output through `Format-Table -AutoSize` before
+outputting to file.
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+Get-Service | Format-Table -AutoSize > services.log
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](about_preference_variables.md#psdefaultparametervalues).
+ ### Potential confusion with comparison operators The `>` operator is not to be confused with the
Microsoft.PowerShell.Utility Out File (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Utility/Out-File.md
provider `Alias:`. The `Get-Location` cmdlet displays the complete path for `Ali
**C:\TestDir\AliasNames.txt**. The `Get-Content` cmdlet uses the **Path** parameter and displays the file's content in the PowerShell console.
+### Example 5: Set file output width for entire scope
+
+This example uses `$PSDefaultParameterValues` to set the `Width` parameter for all invocations of
+`Out-File` and the redirection operartors (`>` and `>>`) to 2000. This is an easy way to ensure
+that everywhere in a scope you output table formatted data to file, PowerShell will use a line
+width of 2000 instead of a line width determined by the PowerShell host's console width.
+
+```powershell
+function DemoDefaultOutFileWidth() {
+ try {
+ $PSDefaultParameterValues['out-file:width'] = 2000
+
+ $logFile = "$pwd\logfile.txt"
+
+ Get-ChildItem Env:\ > $logFile
+
+ Get-Service -ErrorAction Ignore | Format-Table -AutoSize | Out-File $logFile -Append
+
+ Get-Process | Format-Table Id,SI,Name,Path,MainWindowTitle >> $logFile
+ }
+ finally {
+ $PSDefaultParameterValues.Remove('out-file:width')
+ }
+}
+
+DemoDefaultOutFileWidth
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](../Microsoft.Powershell.Core/About/about_preference_variables.md#psdefaultparametervalues).
+ ## PARAMETERS ### -Append
Accept wildcard characters: False
Specifies the number of characters in each line of output. Any additional characters are truncated, not wrapped. If this parameter is not used, the width is determined by the characteristics of the
-host. The default for the PowerShell console is 80 characters.
+host. The default for the PowerShell console is 80 characters. If you want to control the width for
+all invocations of `Out-File` as well as the redirection operators (`>` and `>>`), set
+`$PSDefaultParameterValues['out-file:width'] = 2000` before using `Out-File`.
```yaml Type: System.Int32
PackageManagement Uninstall Package (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/PackageManagement/Uninstall-Package.md
external help file: Microsoft.PowerShell.PackageManagement.dll-Help.xml Locale: en-US Module Name: PackageManagement Previously updated : 05/18/2021 Last updated : 06/04/2021 online version: https://docs.microsoft.com/powershell/module/packagemanagement/uninstall-package?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Uninstall-Package
Title: Uninstall-Package
# Uninstall-Package
-## SYNOPSIS
+## Synopsis
Uninstalls one or more software packages.
-## SYNTAX
+## Syntax
### PackageByInputObject
Uninstall-Package [-AllVersions] [-Force] [-ForceBootstrap] [-WhatIf] [-Confirm]
[-InstallUpdate] [-NoPathUpdate] [-AllowPrereleaseVersions] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Uninstall-Package` cmdlet uninstalls one or more software packages from the local computer. To find installed packages, use the `Get-Package` cmdlet.
-## EXAMPLES
+## Examples
### Example 1: Uninstall a package
PS> Uninstall-Package -Name NuGet.Core
### Example 2: Use the pipeline to uninstall a package `Get-Package` locates a specific package and sends the **SoftwareIdentity** object down the pipeline
-to the `Uninsall-Package` cmdlet.
+to the `Uninstall-Package` cmdlet.
``` PS> Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 | Uninstall-Package
parameter:
`Uninstall-Package -InputObject ( Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 )`
-## PARAMETERS
+## Parameters
### -AllowClobber
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### SoftwareIdentity `Uninstall-Package` accepts **SoftwareIdentity** objects from the pipeline as input.
-## OUTPUTS
+## Outputs
### SoftwareIdentity `Uninstall-Package` returns a **SoftwareIdentity** object for each package uninstalled.
-## NOTES
+## Notes
Including a package provider in a command can make dynamic parameters available to a cmdlet. Dynamic parameters are specific to a package provider. The `Get-Help` cmdlet lists a cmdlet's parameter sets
and includes the provider's parameter set. For example, `Uninstall-Package` has
**PowerShellGet** parameter set that includes `-NoPathUpdate`, `AllowClobber`, and `SkipPublisherCheck`.
-## RELATED LINKS
+## Related Links
[about_PackageManagement](../Microsoft.PowerShell.Core/About/about_PackageManagement.md)
Microsoft.PowerShell.Core About Redirection (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Redirection.md
encoding. If the file has a different encoding, the output might not be
formatted correctly. To write to files with a different encoding, use the `Out-File` cmdlet with its `Encoding` parameter.
+### Width of output when writing to a file
+
+When you are writing to a file using either `Out-File` or the redirection
+operators, PowerShell formats table output to the file based on the width of
+the console it is running within. For instance, when logging table output
+to file using a command like `Get-ChildItem Env:\Path > path.log` on a system
+where the console width is set to 80 columns, the output in the file is
+truncated to 80 characters:
+
+```Output
+Name Value
+---- -----
+Path C:\Program Files\PowerShell\7-preview;C:\WINDOWS…
+```
+
+Considering that the console width may be set arbitrarily on systems where
+your script is run, you may prefer that PowerShell format table output to
+files based on a width that you specify instead.
+
+The `Out-File` cmdlet provides a **Width** parameter that allows you to set
+the width you would like for table output. Rather than having to add
+`-Width 2000` everywhere you invoke `Out-File`, you can use the
+`$PSDefaultParameterValues` variable to set this value for all usages of the
+`Out-File` cmdlet in a script. And since the redirection operators (`>` and
+`>>`) are effectively aliases for `Out-File`, setting the `Out-File:Width`
+parameter for the whole script impacts the formatting width for the
+redirection operators as well. Put the following command near the top of your
+script to set `Out-File:Width` for the whole script:
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+```
+
+Increasing the output width will increase memory consumption when logging
+table formatted output. If you are logging a lot of tabular data to file and
+you know you can get by with a smaller width, use the smaller width.
+
+In some cases, such as `Get-Service` output, in order to use the extra width
+you will need to pipe the output through `Format-Table -AutoSize` before
+outputting to file.
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+Get-Service | Format-Table -AutoSize > services.log
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](about_preference_variables.md#psdefaultparametervalues).
+ ### Potential confusion with comparison operators The `>` operator is not to be confused with the
Microsoft.PowerShell.Utility Out File (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Utility/Out-File.md
provider `Alias:`. The `Get-Location` cmdlet displays the complete path for `Ali
**C:\TestDir\AliasNames.txt**. The `Get-Content` cmdlet uses the **Path** parameter and displays the file's content in the PowerShell console.
+### Example 5: Set file output width for entire scope
+
+This example uses `$PSDefaultParameterValues` to set the `Width` parameter for all invocations of
+`Out-File` and the redirection operartors (`>` and `>>`) to 2000. This is an easy way to ensure
+that everywhere in a scope you output table formatted data to file, PowerShell will use a line
+width of 2000 instead of a line width determined by the PowerShell host's console width.
+
+```powershell
+function DemoDefaultOutFileWidth() {
+ try {
+ $PSDefaultParameterValues['out-file:width'] = 2000
+
+ $logFile = "$pwd\logfile.txt"
+
+ Get-ChildItem Env:\ > $logFile
+
+ Get-Service -ErrorAction Ignore | Format-Table -AutoSize | Out-File $logFile -Append
+
+ Get-Process | Format-Table Id,SI,Name,Path,MainWindowTitle >> $logFile
+ }
+ finally {
+ $PSDefaultParameterValues.Remove('out-file:width')
+ }
+}
+
+DemoDefaultOutFileWidth
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](../Microsoft.Powershell.Core/About/about_preference_variables.md#psdefaultparametervalues).
+ ## PARAMETERS ### -Append
Accept wildcard characters: False
Specifies the number of characters in each line of output. Any additional characters are truncated, not wrapped. If this parameter is not used, the width is determined by the characteristics of the
-host. The default for the PowerShell console is 80 characters.
+host. The default for the PowerShell console is 80 characters. If you want to control the width for
+all invocations of `Out-File` as well as the redirection operators (`>` and `>>`), set
+`$PSDefaultParameterValues['out-file:width'] = 2000` before using `Out-File`.
```yaml Type: System.Int32
PackageManagement Uninstall Package (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/PackageManagement/Uninstall-Package.md
external help file: Microsoft.PowerShell.PackageManagement.dll-Help.xml Locale: en-US Module Name: PackageManagement Previously updated : 05/18/2021 Last updated : 06/04/2021 online version: https://docs.microsoft.com/powershell/module/packagemanagement/uninstall-package?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Uninstall-Package
Title: Uninstall-Package
# Uninstall-Package
-## SYNOPSIS
+## Synopsis
Uninstalls one or more software packages.
-## SYNTAX
+## Syntax
### PackageByInputObject
Uninstall-Package [-AllVersions] [-Force] [-ForceBootstrap] [-WhatIf] [-Confirm]
[-InstallUpdate] [-NoPathUpdate] [-AllowPrereleaseVersions] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Uninstall-Package` cmdlet uninstalls one or more software packages from the local computer. To find installed packages, use the `Get-Package` cmdlet.
-## EXAMPLES
+## Examples
### Example 1: Uninstall a package
PS> Uninstall-Package -Name NuGet.Core
### Example 2: Use the pipeline to uninstall a package `Get-Package` locates a specific package and sends the **SoftwareIdentity** object down the pipeline
-to the `Uninsall-Package` cmdlet.
+to the `Uninstall-Package` cmdlet.
``` PS> Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 | Uninstall-Package
parameter:
`Uninstall-Package -InputObject ( Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 )`
-## PARAMETERS
+## Parameters
### -AllowClobber
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### SoftwareIdentity `Uninstall-Package` accepts **SoftwareIdentity** objects from the pipeline as input.
-## OUTPUTS
+## Outputs
### SoftwareIdentity `Uninstall-Package` returns a **SoftwareIdentity** object for each package uninstalled.
-## NOTES
+## Notes
Including a package provider in a command can make dynamic parameters available to a cmdlet. Dynamic parameters are specific to a package provider. The `Get-Help` cmdlet lists a cmdlet's parameter sets
and includes the provider's parameter set. For example, `Uninstall-Package` has
**PowerShellGet** parameter set that includes `-NoPathUpdate`, `AllowClobber`, and `SkipPublisherCheck`.
-## RELATED LINKS
+## Related Links
[about_PackageManagement](../Microsoft.PowerShell.Core/About/about_PackageManagement.md)
Microsoft.PowerShell.Core About Redirection (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Redirection.md
encoding. If the file has a different encoding, the output might not be
formatted correctly. To write to files with a different encoding, use the `Out-File` cmdlet with its `Encoding` parameter.
+### Width of output when writing to a file
+
+When you are writing to a file using either `Out-File` or the redirection
+operators, PowerShell formats table output to the file based on the width of
+the console it is running within. For instance, when logging table output
+to file using a command like `Get-ChildItem Env:\Path > path.log` on a system
+where the console width is set to 80 columns, the output in the file is
+truncated to 80 characters:
+
+```Output
+Name Value
+---- -----
+Path C:\Program Files\PowerShell\7-preview;C:\WINDOWS…
+```
+
+Considering that the console width may be set arbitrarily on systems where
+your script is run, you may prefer that PowerShell format table output to
+files based on a width that you specify instead.
+
+The `Out-File` cmdlet provides a **Width** parameter that allows you to set
+the width you would like for table output. Rather than having to add
+`-Width 2000` everywhere you invoke `Out-File`, you can use the
+`$PSDefaultParameterValues` variable to set this value for all usages of the
+`Out-File` cmdlet in a script. And since the redirection operators (`>` and
+`>>`) are effectively aliases for `Out-File`, setting the `Out-File:Width`
+parameter for the whole script impacts the formatting width for the
+redirection operators as well. Put the following command near the top of your
+script to set `Out-File:Width` for the whole script:
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+```
+
+Increasing the output width will increase memory consumption when logging
+table formatted output. If you are logging a lot of tabular data to file and
+you know you can get by with a smaller width, use the smaller width.
+
+In some cases, such as `Get-Service` output, in order to use the extra width
+you will need to pipe the output through `Format-Table -AutoSize` before
+outputting to file.
+
+```powershell
+$PSDefaultParameterValues['out-file:width'] = 2000
+Get-Service | Format-Table -AutoSize > services.log
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](about_preference_variables.md#psdefaultparametervalues).
+ ### Potential confusion with comparison operators The `>` operator is not to be confused with the
Microsoft.PowerShell.Utility Out File (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Utility/Out-File.md
provider `Alias:`. The `Get-Location` cmdlet displays the complete path for `Ali
**C:\TestDir\AliasNames.txt**. The `Get-Content` cmdlet uses the **Path** parameter and displays the file's content in the PowerShell console.
+### Example 5: Set file output width for entire scope
+
+This example uses `$PSDefaultParameterValues` to set the `Width` parameter for all invocations of
+`Out-File` and the redirection operartors (`>` and `>>`) to 2000. This is an easy way to ensure
+that everywhere in a scope you output table formatted data to file, PowerShell will use a line
+width of 2000 instead of a line width determined by the PowerShell host's console width.
+
+```powershell
+function DemoDefaultOutFileWidth() {
+ try {
+ $PSDefaultParameterValues['out-file:width'] = 2000
+
+ $logFile = "$pwd\logfile.txt"
+
+ Get-ChildItem Env:\ > $logFile
+
+ Get-Service -ErrorAction Ignore | Format-Table -AutoSize | Out-File $logFile -Append
+
+ Get-Process | Format-Table Id,SI,Name,Path,MainWindowTitle >> $logFile
+ }
+ finally {
+ $PSDefaultParameterValues.Remove('out-file:width')
+ }
+}
+
+DemoDefaultOutFileWidth
+```
+
+For more information about `$PSDefaultParameterValues`, see
+[about_Preference_Variables](../Microsoft.Powershell.Core/About/about_preference_variables.md#psdefaultparametervalues).
+ ## PARAMETERS ### -Append
Accept wildcard characters: False
Specifies the number of characters in each line of output. Any additional characters are truncated, not wrapped. If this parameter is not used, the width is determined by the characteristics of the
-host. The default for the PowerShell console is 80 characters.
+host. The default for the PowerShell console is 80 characters. If you want to control the width for
+all invocations of `Out-File` as well as the redirection operators (`>` and `>>`), set
+`$PSDefaultParameterValues['out-file:width'] = 2000` before using `Out-File`.
```yaml Type: System.Int32
PackageManagement Uninstall Package (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/PackageManagement/Uninstall-Package.md
external help file: Microsoft.PowerShell.PackageManagement.dll-Help.xml Locale: en-US Module Name: PackageManagement Previously updated : 05/18/2021 Last updated : 06/04/2021 online version: https://docs.microsoft.com/powershell/module/packagemanagement/uninstall-package?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Uninstall-Package
Title: Uninstall-Package
# Uninstall-Package
-## SYNOPSIS
+## Synopsis
Uninstalls one or more software packages.
-## SYNTAX
+## Syntax
### PackageByInputObject
Uninstall-Package [-AllVersions] [-Force] [-ForceBootstrap] [-WhatIf] [-Confirm]
[-InstallUpdate] [-NoPathUpdate] [-AllowPrereleaseVersions] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Uninstall-Package` cmdlet uninstalls one or more software packages from the local computer. To find installed packages, use the `Get-Package` cmdlet.
-## EXAMPLES
+## Examples
### Example 1: Uninstall a package
PS> Uninstall-Package -Name NuGet.Core
### Example 2: Use the pipeline to uninstall a package `Get-Package` locates a specific package and sends the **SoftwareIdentity** object down the pipeline
-to the `Uninsall-Package` cmdlet.
+to the `Uninstall-Package` cmdlet.
``` PS> Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 | Uninstall-Package
parameter:
`Uninstall-Package -InputObject ( Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 )`
-## PARAMETERS
+## Parameters
### -AllowClobber
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### SoftwareIdentity `Uninstall-Package` accepts **SoftwareIdentity** objects from the pipeline as input.
-## OUTPUTS
+## Outputs
### SoftwareIdentity `Uninstall-Package` returns a **SoftwareIdentity** object for each package uninstalled.
-## NOTES
+## Notes
Including a package provider in a command can make dynamic parameters available to a cmdlet. Dynamic parameters are specific to a package provider. The `Get-Help` cmdlet lists a cmdlet's parameter sets
and includes the provider's parameter set. For example, `Uninstall-Package` has
**PowerShellGet** parameter set that includes `-NoPathUpdate`, `AllowClobber`, and `SkipPublisherCheck`.
-## RELATED LINKS
+## Related Links
[about_PackageManagement](../Microsoft.PowerShell.Core/About/about_PackageManagement.md)
dsc Lnxgettingstarted https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/dsc/getting-started/lnxGettingStarted.md
--- Previously updated : 01/07/2021 Last updated : 06/04/2021 keywords: dsc,powershell,configuration,setup Title: Get started with Desired State Configuration (DSC) for Linux description: This topic explains how to get started using PowerShell Desired State Configuration (DSC) for Linux.
For general information about DSC, see
The following Linux operating system versions are supported by DSC for Linux. -- CentOS 5, 6, and 7 (x86/x64)-- Debian GNU/Linux 6, 7 and 8 (x86/x64)-- Oracle Linux 5, 6 and 7 (x86/x64)-- Red Hat Enterprise Linux Server 5, 6 and 7 (x86/x64)-- SUSE Linux Enterprise Server 10, 11 and 12 (x86/x64)-- Ubuntu Server 12.04 LTS, 14.04 LTS, 16.04 LTS, 18.04 (x86/x64)
+- CentOS 6, 7, and 8 (x64)
+- Debian GNU/Linux 8, 9, and 10 (x64)
+- Oracle Linux 6 and 7 (x64)
+- Red Hat Enterprise Linux Server 6, 7, and 8 (x64)
+- SUSE Linux Enterprise Server 12 and 15 (x64)
+- Ubuntu Server 14.04 LTS, 16.04 LTS, 18.04 LTS, and 20.04 LTS (x64)
## Installing DSC for Linux
Run the following command to install OMI on a CentOS 7 x64 system.
### Installing DSC DSC for Linux is available for download from the
-[PowerShell-DSC-for-Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/tag/v1.1.1-926)
+[PowerShell-DSC-for-Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/tag/v1.2.1-0)
repository in the repository. To install DSC, install the package that is appropriate for your Linux system (.rpm or .deb) and