This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5 | |
# Version 1.2.16 | |
# check if newer version | |
$gistUrl = "https://api.github.com/gists/c35da09661305cf04fdfa15c0af7bb1a" | |
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version') | |
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)" | |
if ([System.IO.File]::Exists($latestVersionFile)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config interface 'loopback' | |
option ifname 'lo' | |
option proto 'static' | |
option ipaddr '127.0.0.1' | |
option netmask '255.0.0.0' | |
config globals 'globals' | |
option ula_prefix 'auto' | |
option default_ps '0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config interface 'loopback' | |
option ifname 'lo' | |
option proto 'static' | |
option ipaddr '127.0.0.1' | |
option netmask '255.0.0.0' | |
config globals 'globals' | |
option ula_prefix 'auto' | |
option default_ps '0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory=$true)] | |
[String] | |
$computerName, | |
[Int] | |
$maxEvents = 1000 | |
) | |
$commands = @() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Get-ADDomainController -Filter *).Hostname | Sort-Object -Unique | % { Invoke-Command -ComputerName $_ -ScriptBlock { New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\DNS\parameters -Name "TcpReceivePacketSize" -PropertyType DWord -Value 0xFF00 -Force ; Restart-Service DNS } ; Start-Sleep 30 ; Resolve-DNSName $_ -Server $_} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get current WSUS setting | |
$existingValue = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer).UseWUServer | |
# Disable WSUS | |
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value 0 | |
# Restart WSUS | |
Restart-Service wuauserv | |
# Install the pack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ADTime { | |
Param( | |
[Switch]$IncludeUptime | |
) | |
$pdcName = Get-ADForest | Select-Object -ExpandProperty RootDomain | Get-ADDomain | Select-Object -ExpandProperty PDCEmulator | |
net time \\$pdcName /set /y | |
$outtab = @() | |
(Get-ADForest).GlobalCatalogs | sort | % { | |
$rawtime = w32tm /stripchart /computer:$_ /dataonly /samples:1 | Select -Last 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start-Transcript "$($ENV:Temp)\VMStart.Log" | |
$AzureUser = "[email protected]" | |
$EncodedPassword = "PASTE ENCODED PASSWORD HERE" | |
$SecureStringPwd = ConvertTo-SecureString $EncodedPassword | |
$AzureCredential = New-Object System.Management.Automation.PSCredential ( | |
$AzureUser, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Store the password in a SecureString | |
$Credential = Get-Credential -Message "Enter the Azure Account Password" -UserName "Anything" | |
$EncodedPassword = $Credential.Password | ConvertFrom-SecureString | |
$EncodedPassword | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"schema": [ | |
{ | |
"mode": "rw", | |
"code": "led_switch", | |
"name": "开关", | |
"property": { | |
"type": "bool" | |
}, | |
"iconname": "icon-dp_power", |
NewerOlder