Advertisement
RulerOf

Simple string substitution

Mar 6th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $list="Item1","Item2","Item3"
  2.  
  3. $template = Get-Content ~\Desktop\template.txt
  4.  
  5. ForEach ($name in $list) { $template -replace ("%%%", $name) | Write-Output }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement