Created
April 20, 2016 15:41
-
-
Save jmahlman/68127c295010a8d1b514c1ca34231e02 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
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit | |
} | |
$hostMac = Get-Content \\Mac\Home\Public\hostname | |
$newName = "vm-$hostMac" | |
echo "Renaming Compter to $newName" | |
Rename-Computer -NewName $newName | |
echo "Setting up UArts-User account to auto-login with no password." | |
cmd.exe /c 'C:\Users\Public\autoLogin.bat' | |
echo "RESTARTING VIRTUAL MACHINE NOW!!!!!!!!" | |
sleep 1 | |
echo "The answer is 42" | |
Restart-Computer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment