Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## in -replace ( ) are used to define matching groups so $1 is the first match group, eg .*<WindowsTargetPlatformVersion> which we insert back in the replacement string via ${1}. Similarly ${3} for the last match </WindowsTargetPlatformVersion> so we are replacing everything within those two tags in the file
- Get-ChildItem -Path "*.vcxproj" -file -force -recurse| ForEach-Object { Copy-Item "$($_.FullName)" "$($_.FullName).bak" ; ( Get-Content $_.FullName ) -replace '(.*<WindowsTargetPlatformVersion>)(.*)(</WindowsTargetPlatformVersion>)' , '${1}10.0.18362.0${3}' | Set-Content $_.FullName }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement