This file contains hidden or 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
<# | |
.DESCRIPTION | |
Generates Gameshark codes for Pokemon Gold/Silver/Crystal to encounter a specific Pokemon at a specific level | |
Takes user input for the Pokemon name and level and generates the codes | |
#> | |
function ConvertTo-Hex { | |
param ( | |
[Parameter(Mandatory=$true)] | |
[int]$Number |
This file contains hidden or 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
# This will ping google to test for a WAN connection and reboot if it fails | |
# Workaround to my Windows Sandbox always losing network | |
# The weird logging to write-host/write-output is designed to be used with Windows task scheduler (interactive logon) or via console directly | |
$host.ui.RawUI.WindowTitle = "Network Checker" | |
Clear-Host | |
$dt = (get-date).toString() | |
Write-Host "Network Check Running. Logfile: C:\Users\$($env:username)\networkCheck.log" | |
Write-Output "[$dt] Network Check Running. Logfile: C:\Users\$($env:username)\networkCheck.log" | Out-File -FilePath "C:\Users\$($env:username)\networkCheck.log" -Encoding utf8 -Append |
This file contains hidden or 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]$privateKeyFilePath | |
) | |
# Remove inheritance from the private key file to prevent inheriting permissions from parent directories | |
. icacls $privateKeyFilePath /c /t /Inheritance:d | |
# Grant full control to the current user for keys within the user profile directory | |
. icacls $privateKeyFilePath /c /t /Grant ${env:UserName}:F |
This file contains hidden or 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
# Modify Hosts file (/jffs/configs/hosts.add) | |
service restart_dnsmasq | |
# Parse Custom Client List | |
nvram get custom_clientlist | sed 's/</\n/g; s/>/\t/g' | sed 's/^/custom\t/' | tail '+2' | sed 's/\(^.*\)\(\t.*\)\(\t[0-9A-F][0-9A-F]:.*$\)/\1\3\2/' | |
# Remove Logged in User restriction | |
nvram unset login_ip | |
nvram commit |
This file contains hidden or 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-RandomIPAddressInCIDR { | |
param ( | |
[string]$CIDR | |
) | |
# Split the CIDR into network address and subnet mask | |
$networkAddress, $subnetMaskBits = $CIDR -split '/' | |
$subnetMaskBits = [int]$subnetMaskBits | |
if ($subnetMaskBits -eq 32) { |
This file contains hidden or 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
$outputFileName = "C:\Temp\File_{0:yyyyMMdd}_{0:HHmmss}.csv" -f (Get-Date) | |
#C:/Temp/File_20230510_115723.csv |
This file contains hidden or 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
# Use chocolatey to refresh the path | |
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" | |
Update-SessionEnvironment -Full |
This file contains hidden or 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
## https://devblogs.microsoft.com/powershell/psreadline-2-2-6-enables-predictive-intellisense-by-default ## | |
# Get Configuration | |
Get-PSReadLineOption | |
## Get Intellisense Option | |
(Get-PSReadLineOption).PredictionSource | |
# Command History Path | |
(Get-PSReadLineOption).HistorySavePath |
This file contains hidden or 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 a listing of all clusters (CLUS) | |
$clusters = Get-ADComputer -Filter "Name -like 'CLUS'" | |
#Set Domain | |
$DNSServer = (Get-ADDomain).PDCEMulator | |
#Set DNS Zone | |
$DNSZone = "dev.contoso.com" | |
#Iterate through the list of clusters get dns and add the appropriate full control objects (listener, cluster) |