# Set execution policy Set-ExecutionPolicy Bypass -Force # Create working directory New-Item -Type Directory C:\DPAutomation\ -Force $ServerName = "WINSERVER01" # Download the Windows PSM $Source = "http://toolkit.datapipe.net/BesTasks/anthony/WindowsPSM/DPWinAws.psm1" $Destination = "C:\DPAutomation\DPWinAws.psm1" $client = new-object System.Net.WebClient $client.DownloadFile($Source, $Destination) # Import the Windows PSM Import-Module C:\DPAutomation\DPWinAws.psm1       # Disable Windows FW DPDisbaleWindowsFW # Set timezone DPAWSSetTimezone  -Log Y # Install .NET 4.5.2 DPInstallNET452 # Install Windows Updates DPInstallWindowsUpdates -InstallOptional Y # Rename the server DPRenameServer -ServerName $Servername # Remove working directory Remove-Item C:\DPAutomation\ -Recurse -Force shutdown -r -t 0