# Configure your message HTML here.
$bodyHtml = @"
<html>
<head>
<title>Hello!</title>
</head>
<body>
<h2>Hello SocketLabs!</h2>
This is an example message.
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 Test-Speed { | |
param( | |
[string] $TestUrl | |
) | |
# Create an HttpClient object | |
$client = New-Object System.Net.Http.HttpClient; | |
# Create a Stopwatch to test the download speed. | |
$sw = New-Object System.Diagnostics.Stopwatch; | |
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
# Delete all the Recycle Bins | |
Get-ChildItem -Path 'C:\$Recycle.Bin\' -Recurse -Hidden | Remove-Item -Force -Recurse -Verbose | |
# Delete all User Profiles on computer except active profiles. | |
# Warning! this will delete all documents and files under the user profile. | |
$profiles = Get-WMIObject -class Win32_UserProfile | Where-Object { $_.Special -eq $false -and $_.Status -eq 0 -and $_.Loaded -eq $false } | |
$profiles | Remove-WmiObject |
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
cd $env:USERPROFILE\Desktop | |
mkdir winget | |
cd winget | |
# Download appx bundles | |
if(-Not (Test-Path '.\microsoft.ui.xaml.2.7.3\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx')) | |
{ | |
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 -OutFile .\microsoft.ui.xaml.2.7.3.zip | |
Expand-Archive .\microsoft.ui.xaml.2.7.3.zip | |
} |
Many people want to install Unifi into the Program Files
folder on Windows.
By default the installer installs into the current users profile folder.
For some reason there isn't any information on how to do this. Many people come up with all kinds of hacks such as using symlinks to achieve the same effect.
In reality the UniFi-installer.exe
is a Nullsoft NSIS installer that accepts the standard command line argument for specifying a directory
Just run this command and it will install it into the specified directory:
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
# Creates PTR Records for all A Records in the specified -ZoneName. | |
# Uses a Class A Subnet for the reverse zone. | |
$computerName = 'dns-server01'; | |
# Get all the DNS A Records. | |
$records = Get-DnsServerResourceRecord -ZoneName 'zone.example.com' -RRType A -ComputerName $computerName; | |
foreach ($record in $records) | |
{ | |
# The reverse lookup domain name. This is the PTR Response. | |
$ptrDomain = $record.HostName + '.zone.example.com'; |