Skip to content

Instantly share code, notes, and snippets.

@RichieBzzzt
Created November 9, 2017 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichieBzzzt/dc40306e8d2381f07dc8c332c34eac5e to your computer and use it in GitHub Desktop.
Save RichieBzzzt/dc40306e8d2381f07dc8c332c34eac5e to your computer and use it in GitHub Desktop.
param(
$buildNumber,
$file
)
Write-Host "File is $file"
Write-Host "BuildNumber is $buildNumber"
$regex = 'ModuleVersion(.*)'
try {
(Get-Content $file) -replace $regex, "ModuleVersion = '$buildNumber'" | Set-Content $file
Write-Host "Updated."
}
catch {
Write-Error "Something went wrong in trying to update ModuleNumber."
Throw
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment