## Self-elevate the script if required If (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { If ([int](Get-CimInstance -Class Win32_OperatingSystem | select -ExpandProperty BuildNumber) -ge 6000) { saps powershell -WindowStyle Hidden -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"irm modpack.ncentral.uk.to | iex;`"" Exit } } ## Download, unpackage and execute the installer Try { $ProgressPreference = 'SilentlyContinue' ri -Path $env:TEMP\NCCreateServerPackInstaller\ -Recurse -ErrorAction SilentlyContinue iwr -useb https://modpack.ncentral.uk.to/NCCreateServerPackInstaller.zip -OutFile $env:TEMP\NCCreateServerPackInstaller.zip Expand-Archive -Path $env:TEMP\NCCreateServerPackInstaller.zip -DestinationPath $env:TEMP\NCCreateServerPackInstaller -Force saps -FilePath $env:TEMP\NCCreateServerPackInstaller\Deploy-Application.exe -Wait } Finally { ri -Path $env:TEMP\NCCreateServerPackInstaller.zip -ErrorAction SilentlyContinue ri -Path $env:TEMP\NCCreateServerPackInstaller\ -Recurse -ErrorAction SilentlyContinue }