The set-content command sets the content in the item at the specified location.
Snap-In: Microsoft.PowerShell.Management
Syntax:
Set-Content
[-Path] <String[]> [-Value] <Object[]> [-PassThru] [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force] [-Credential <PSCredential>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm] [-Encoding <FileSystemCmdletProviderEncoding>]
Description:
The set-content Cmdlet sets the input content into the specified item or file. Whereas add-content appends to a file, set-content replaces whatever is in the file with the new content. The content can be input directly or pipelined into the cmdlet. The content may need to be providerspecific depending upon what the destination file is.