Skip to content

Instantly share code, notes, and snippets.

@jdhitsolutions
jdhitsolutions / Get-DockerContainer.ps1
Last active November 10, 2023 15:51
A PowerShell function to get docker containers as objects.
#requires -version 5.1
Function Get-DockerContainer {
[cmdletbinding(DefaultParameterSetName = "name")]
[alias("gdc")]
[OutputType("Get-DockerContainer.myDockerContainer")]
Param(
[Parameter(Position = 0, HelpMessage = "Enter a docker container name. The default is all running containers.", ParameterSetName = "name")]
[ValidateNotNullorEmpty()]
@Saturate
Saturate / GetAllWifiPasswords.ps1
Last active March 10, 2023 08:09
PowerShell Wifi Script
# Run this script as an Admin user and get a list of all WiFi passwords.
$listProfiles = netsh wlan show profiles | Select-String -Pattern "All User Profile" | %{ ($_ -split ":")[-1].Trim() };
$listProfiles | foreach {
$profileInfo = netsh wlan show profiles name=$_ key="clear";
$SSID = $profileInfo | Select-String -Pattern "SSID Name" | %{ ($_ -split ":")[-1].Trim() };
$Key = $profileInfo | Select-String -Pattern "Key Content" | %{ ($_ -split ":")[-1].Trim() };
[PSCustomObject]@{
WifiProfileName = $SSID;
Password = $Key
}
@DBremen
DBremen / ISECodeTemplate.ps1
Created August 24, 2015 14:55
Create default code template for PowerShell ISE
function Edit-ISETemplate{
$ISETemplatePath = "$([Environment]::GetFolderPath('MyDocuments'))\WindowsPowerShell\ISETemplate.ps1"
if (!Test-Path){
New-Item $ISETemplatePath -ItemType File
}
psedit "$ISETemplatePath"
}
Register-ObjectEvent $psise.CurrentPowerShellTab.Files CollectionChanged -Action {
# files collection