Skip to content

Instantly share code, notes, and snippets.

@brettmillerb
Created January 30, 2019 11:49
Show Gist options
  • Save brettmillerb/e22f2018669931f9cd55eb072a25ac08 to your computer and use it in GitHub Desktop.
Save brettmillerb/e22f2018669931f9cd55eb072a25ac08 to your computer and use it in GitHub Desktop.
function Backup-Profile {
[CmdletBinding()]
param (
[string]
$Path = "C:\support\git\gitwork\profile",
[switch]
$Push
)
Push-Location $Path
Copy-Item -Path $profile.CurrentUserAllHosts -Destination .\
if ($Push) {
git commit -am ("Updated Profile {0}" -f ((get-date).ToString("yyyy-MM-dd-hh:mm:ss")))
git push -u origin master
}
Pop-Location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment