Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Created February 18, 2016 16:41
Show Gist options
  • Select an option

  • Save Dalmirog-zz/2a5a4d3a720e128b3711 to your computer and use it in GitHub Desktop.

Select an option

Save Dalmirog-zz/2a5a4d3a720e128b3711 to your computer and use it in GitHub Desktop.
rename cscfg file
$EnvironmentName = $OctopusParameters['Octopus.Environment.Name']
$cscfgFile = Get-ChildItem | ?{$_.Name -like "*cscfg"}
if($cscfgFile.count -ne 1){
Write-error "Amount of .CSCFG files found: $($cscfgFile.count) . There should be (only) 1 CSCFG file"
}
Rename-Item -path $cscfgFile.FullName -NewName "ServiceConfiguration.$EnvironmentName.cscfg" -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment