Skip to content

Instantly share code, notes, and snippets.

@ddhahn
Created February 1, 2013 16:41
Show Gist options
  • Save ddhahn/4692474 to your computer and use it in GitHub Desktop.
Save ddhahn/4692474 to your computer and use it in GitHub Desktop.
Uses a CSV of locations and gateways to help generate a bootstrap.ini file
##generate bootstrap.ini settings
$csv = Import-Csv -Path c:\temp\import.csv
del c:\temp\defaultgateway-out.txt
del c:\temp\defaultgateway-out1.txt
for ($i=0;$i -le $csv.count;$i++) {
##output assignments for [defaultgateway] string
$outstring = $csv[$i]."Default Gateway for Workstations (used to target deployroot)" + "=" + $csv[$i]."office name"
Out-File -InputObject $outstring -FilePath "c:\temp\defaultgateway-out.txt" -Encoding ASCII -Append
$outstring = "[" + $csv[$i]."office name" + "]"
Out-File -InputObject $outstring -FilePath "c:\temp\defaultgateway-out1.txt" -Encoding ASCII -Append
$outstring = "deployroot=\\" + $csv[$i]."server name" + "\" + $csv[$i]."share"
Out-File -InputObject $outstring -FilePath "c:\temp\defaultgateway-out1.txt" -Encoding ASCII -Append
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment