Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/BreakingChangeMigration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Define the path to the CSV file and the script file
$csvPath = "docs\PowerShellBreakingChanges-V1.0.csv" #"docs\PowerShellBreakingChanges-Beta.csv"
$scriptPath = "<Path to your script>"
$newScriptPath = "<Path to save the updated script>"

# Import the CSV file
$cmdletMappings = Import-Csv -Path $csvPath

# Read the script file contents
$scriptContent = Get-Content -Path $scriptPath -Raw

# Replace old cmdlets with new cmdlets
foreach ($mapping in $cmdletMappings) {
$oldCmdlet = $mapping.OldCmdlet
$newCmdlet = $mapping.NewCmdlet
$scriptContent = $scriptContent -replace $oldCmdlet, $newCmdlet
}

# Save the updated script content to a new file
$scriptContent | Set-Content -Path $newScriptPath

Write-Host "Script updated and saved to $newScriptPath"