Advertisement
Guest User

fix_asstr.ps1

a guest
Mar 30th, 2021
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [Threading.Thread]::GetDomain().SetPrincipalPolicy([Security.Principal.PrincipalPolicy]::WindowsPrincipal)
  2. $thread_security_principal = `
  3.   [Security.Principal.WindowsPrincipal]([Threading.Thread]::CurrentPrincipal)
  4. if ( -NOT $thread_security_principal.IsInRole("Administrators") ) {
  5.     $argv = @($MyInvocation.MyCommand.Definition) + $args
  6.     start-process "powershell.exe" -Arg $argv -Verb RunAs
  7.     exit 2
  8. }
  9.  
  10. $hostsFilePath = "$($Env:WinDir)\system32\Drivers\etc\hosts"
  11. $hostsFile = Get-Content $hostsFilePath
  12.  
  13. $IP="64.71.155.222"
  14. $NAME="www.asstr.org asstr.org ftp.asstr.org"
  15.  
  16. Write-Host "About to add  for $IP $NAME to hosts file" -ForegroundColor Gray
  17.  
  18.  
  19. Add-Content -Encoding UTF8  $hostsFilePath ("$IP".PadRight(20, " ") + "$NAME")
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement