Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Threading.Thread]::GetDomain().SetPrincipalPolicy([Security.Principal.PrincipalPolicy]::WindowsPrincipal)
- $thread_security_principal = `
- [Security.Principal.WindowsPrincipal]([Threading.Thread]::CurrentPrincipal)
- if ( -NOT $thread_security_principal.IsInRole("Administrators") ) {
- $argv = @($MyInvocation.MyCommand.Definition) + $args
- start-process "powershell.exe" -Arg $argv -Verb RunAs
- exit 2
- }
- $hostsFilePath = "$($Env:WinDir)\system32\Drivers\etc\hosts"
- $hostsFile = Get-Content $hostsFilePath
- $IP="64.71.155.222"
- $NAME="www.asstr.org asstr.org ftp.asstr.org"
- Write-Host "About to add for $IP $NAME to hosts file" -ForegroundColor Gray
- Add-Content -Encoding UTF8 $hostsFilePath ("$IP".PadRight(20, " ") + "$NAME")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement