Skip to content

Instantly share code, notes, and snippets.

View kenpb's full-sized avatar

Kenneth P. Barquero kenpb

  • Cartago, Costa Rica
View GitHub Profile
@kenpb
kenpb / disable-windows-firewall.ps1
Last active August 3, 2018 10:08
Disable windows stuff
# source: https://blogs.technet.microsoft.com/heyscriptingguy/2012/10/28/powertip-use-powershell-to-enable-the-windows-firewall/
# older Wins: netsh advfirewall set allprofiles state off
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
@kenpb
kenpb / elevator.ps1
Created November 17, 2015 00:57
A self elevating PowerShell script
# @source => http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/09/23/a-self-elevating-powershell-script.aspx
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
# Get the security principal for the Administrator role
@kenpb
kenpb / create-shortcuts.ps1
Created November 16, 2015 01:10
A simple script to create shortcuts with powershell
$root = "\\VBOXSRV\"
$folders = "common", "vagrant"
$nCOM = New-Object -ComObject WScript.Shell
$folders | ForEach-Object {
$shortcut = $nCOM.CreateShortcut("$Home\Desktop\" + $_ + " (VBOXSRV).lnk")
$shortcut.TargetPath = $root + $_
$shortcut.Save()
}
@kenpb
kenpb / upgrade-windowserver-edition.ps1
Last active November 16, 2015 01:12
Upgrade from WS12R2 Eval to Standard
DISM /online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula