Tinus EngOps Wiki

Logo

OpsaC - Operating as PowerShell code

Links

Home

IT-Wiki

PowerShell Blog

PowerShell Index

PowerShell Search

Additional Websites

View my GitHub Profile

View my GitHub Gists

View my Codeberg Page

View my Photo Website

Replace content

published: June 28, 2018 author: Tinu tags: Scripting categories: PowerShell


Mit PowerShell Text in einem File ändern, kann auch in einer Remote Session durchgeführt werden:

$file        = "C:\Temp\file.txt"
$searchfor   = "alpha"
$replacewith = "beta"
(Get-Content $file).Replace($searchfor, $replacewith) | Set-Content $file -Force -PassThru

← Previous Post ◇ [ Top ] ◇ Copyright © 2024 by tinuwalther ◇ [ Blog ] ◇ Next Post →