Contact Info

Crumbtrail » Administration » Powershell » Powershell 3.0 » Set-Content

Set-Content - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Replaces the contents of a file with contents that you specify.

Set-Content [-Path] <String[]> [-Value] <Object[]> [-Credential <PSCredential>] [-Exclude <String[]>] [-Filter <String>
] [-Force] [-Include <String[]>] [-PassThru] [-Confirm] [-WhatIf] [-UseTransaction [<SwitchParameter>]] [<CommonParamet
Set-Content [-Value] <Object[]> [-Credential <PSCredential>] [-Exclude <String[]>] [-Filter <String>] [-Force] [-Includ
e <String[]>] [-PassThru] -LiteralPath <String[]> [-Confirm] [-WhatIf] [-UseTransaction [<SwitchParameter>]] [<CommonPa
Set-Content [-Encoding {Unknown | String | Unicode | Byte | BigEndianUnicode | UTF8 | UTF7 | UTF32 | Ascii | Default | 
Oem}] [-Force] [-Stream <string>] [-Confirm] [-WhatIf] [-UseTransaction] [<CommonParameters>]

The Set-Content cmdlet is a string-processing cmdlet that writes or replaces the content in the specified item, such as
 a file. Whereas the Add-Content cmdlet appends content to a file, Set-Content replaces the existing content. You can t
ype the content in the command or send content through the pipeline to Set-Content.

In file system drives, the Set-Content cmdlet overwrites or replaces the content of one or more files with the content 
that you specify. This cmdlet is not valid on folders.

Note: This custom cmdlet help file explains how the Set-Content cmdlet works in a file system drive. For information ab
out the Set-Content cmdlet in all drives, type "Get-Help Set-Content -Path $null" or see Set-Content at http://go.micro