Skip to content

Instantly share code, notes, and snippets.

View Get-CsTopologyFixed.ps1
Get-CsTopologyFixed.ps1 v1.0
Last updated 2015-02-27 by Amanda Debler,
Please let me know about any improvements you've made or mistakes you've found!
amandadebler / Base64.ps1
Created May 29, 2020 12:51
Convert to and from Base64, since there's no built-in Windows command for this
View Base64.ps1
function ConvertTo-Base64 {
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text)
function ConvertFrom-Base64 {
amandadebler / Get-Portfolio
Created August 26, 2019 15:03
The robo-advisor in PowerShell that no one asked for
View Get-Portfolio
function Get-Portfolio {
param (
$transactionCost = 5,
$maxCostRatio = 0.02
begin {
View Get-SharesInAmount.ps1
function Get-SharesInAmount {
param (
$transactionCost = 5,
$maxCostRatio = 0.02
begin {
amandadebler / Get-SP500Summary.ps1
Last active August 26, 2019 10:19
S&P 500 weights and latest closing prices
View Get-SP500Summary.ps1
$response = invoke-webrequest ""
$table = $response.parsedhtml.body.childnodes[6].childnodes[1].childnodes[0].childnodes[0].childnodes[1].childnodes[0]
# Column Headers
$columns = foreach ($node in $table.childnodes[0].childnodes[0].childnodes) {$node.innertext}
$stockrows = $table.childnodes[1].childnodes
$stocks = foreach ($row in $stockrows) {
$attributes = @{}
for ($i=0; $i -lt $($columns.count); $i++) {
amandadebler / PowerShell Prompt.ps1
Last active March 12, 2019 22:28 — forked from fatherjack/PowerShell Prompt.ps1
Two-line prompt with last command execution time and tail of present working directory - modification of FatherJack's prompt, which was inspired by FriedrichWeinmann
View PowerShell Prompt.ps1
function Prompt {
try {
$history = Get-History -ErrorAction Ignore -Count 1
if ($history) {
$ts = New-TimeSpan $history.StartExecutionTime $history.EndExecutionTime
Write-Host "[" -NoNewline
switch ($ts) {
{$_.TotalSeconds -lt 1} {
[decimal]$d = $_.TotalMilliseconds
amandadebler / AKSDockerVersionReporter.ps1
Created February 13, 2019 08:31
Reports the Docker runtime version for all nodes in all AKS clusters in all subscriptions in an Azure tenant
View AKSDockerVersionReporter.ps1
$mySubscriptions = $(az account list --query [].id -o tsv)
foreach ($subscription in $mySubscriptions) {
$clusters = $(az aks list --subscription $subscription) | ConvertFrom-Json
foreach ($cluster in $clusters) {
"$($ in resource group $($cluster.resourceGroup) in subscription $subscription"
az aks get-credentials --resource-group $($cluster.resourceGroup) --name $($ --subscription $subscription --overwrite-existing
kubectl get nodes -o,VERSION:.status.nodeInfo.containerRuntimeVersion
amandadebler / CVE-2019-5736-hotfix.ps1
Created February 13, 2019 07:39
For CVE-2019-5736 (runc container breakout)
View CVE-2019-5736-hotfix.ps1
# works with both Get-AzAks cluster object and az aks list | ConvertFrom-Json PSCustomObjects
function Get-AKSHotfixVersion {
$hotfixVersions = @{'12'='1.12.5'; '11'='1.11.7'; '10'='1.10.12'; '9'='1.9.11'}
foreach ($cluster in $AKSCluster) {
$currentVersion = $cluster.KubernetesVersion
[string]$majorRelease = $currentVersion.split('.')[1]
$hotfixVersion = $hotfixVersions.$majorRelease
amandadebler / bamf_histograms
Last active January 26, 2019 14:06 — forked from ynux/bamf_histograms
English translation of landing page
View bamf_histograms
<p>On this page, we present the <a href="äftsstatistik/asylgeschaeftsstatistik-node.html">decision statistics of the BAMF</a> (Bundesagentur für Migration und Flüchtlinge - German federal agency for immigration and refugees) as histograms. They are supplemented monthly, at present most of them go through October. The new statistics should be published in the middle of the following month; the webpage is usually updated by the end of the month. Recent data and the numbers for countries from which fewer asylum seekers come can be found here: <a href="">Interactive Dashboard</a> .</p>
<p>For each country, we offer the link to the latest German national report from Amnesty International. The graphics for 2015 to 2016 can be found for most countries on <a href="">this page (German only)</a> &nbsp;</p>
<p><a href="#Afghanistan">Afghanistan</a> | <a href="#Syrien">Syr
View Ignore-SSLErrors.ps1
$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
Add-Type -AssemblyName System.Web
Add-Type -AssemblyName system.Security
Add-Type -AssemblyName System
Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {