Created
January 30, 2019 11:49
-
-
Save brettmillerb/e22f2018669931f9cd55eb072a25ac08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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