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
<# | |
.SYNOPSIS | |
Automated process to stop unused session hosts in a Azure Virtual Desktop (AVD) personal host pool. | |
.DESCRIPTION | |
This script is intended to automatically stop personal host pool session hosts in a Azure Virtual Desktop | |
host pool. The script will evaluate session hosts in a host pool and create a list of session hosts with | |
active connections. The script will then compare all session hosts in the personal host pool that are | |
powered on and not in drain mode. The script will shut down the session hosts that have no active connections. | |
.NOTES |
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": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"artifactsLocation": { | |
"defaultValue": "https://wvdportalstorageblob.blob.core.windows.net/galleryartifacts/Configuration.zip", | |
"type": "String", | |
"metadata": { | |
"description": "The base URI where artifacts required by this template are located." | |
} |
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
$output = get-childitem -force \\$computer\c$\users\$user -Directory | | |
foreach-object { | |
$len = 0 | |
measure-childitem $_.FullName -ErrorAction SilentlyContinue | foreach-object { $len += $_.Size } | |
[pscustomobject]@{ | |
Name = $_.FullName | |
SizeGB = [math]::round($len / 1Gb, 2) | |
} | |
} |
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 CleanVariables { Get-Variable | Where-Object { $startupVariables -notcontains $_.Name } | ForEach-Object { | |
try { Remove-Variable -Name "$($_.Name)" -Force -Scope "global" -ErrorAction SilentlyContinue -WarningAction SilentlyContinue } | |
catch { } | |
} | |
} | |
CleanVariables | |
<# This form was created using POSHGUI.com a free online gui designer for PowerShell | |
.NAME |
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 CleanVariables { Get-Variable | Where-Object { $startupVariables -notcontains $_.Name } | ForEach-Object { | |
try { Remove-Variable -Name "$($_.Name)" -Force -Scope "global" -ErrorAction SilentlyContinue -WarningAction SilentlyContinue } | |
catch { } | |
} | |
} | |
CleanVariables | |
<# This form was created using POSHGUI.com a free online gui designer for PowerShell | |
.NAME |
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
2019-08-08T22:47:43.993+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/002750 T=000000/001365/001098 (A/I/O) Loss=0.00%/0.00% (R/T) | |
2019-08-08T22:48:44.071+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/004875 T=000000/002682/002119 (A/I/O) Loss=0.00%/0.00% (R/T) | |
2019-08-08T22:49:44.328+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/008169 T=000000/004467/003477 (A/I/O) Loss=0.00%/0.00% (R/T) | |
2019-08-08T22:50:44.324+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/010081 T=000356/005626/004329 (A/I/O) Loss=0.00%/0.00% (R/T) | |
2019-08-08T22:51:44.569+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/012161 T=000356/006768/005296 (A/I/O) Loss=0.00%/0.00% (R/T) | |
2019-08-08T22:52:44.641+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/013773 T=000356/007559/005970 (A/I/O) Loss=0.00%/0.00% (R/T) | |
2019-08-08T22:53:44.899+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/015832 T=000356/009122/00685 |
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
Connect-VIServer asdf | |
Clear-Variable report | |
$report = Get-Datacenter -PipelineVariable datacenter | | |
ForEach-Object { | |
get-cluster -Location $_ -PipelineVariable cluster | | |
ForEach-Object { get-vmhost -Location $_ | | |
foreach-object {[pscustomobject]@{ | |
Datacenter=$datacenter.Name; |
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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <ESP8266mDNS.h> | |
#include <WiFiUdp.h> | |
#include <ArduinoOTA.h> | |
#include "secrets.h" | |
#define ROOM "what" | |
#define NAME "ever" |
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
#include <Servo.h> | |
Servo esc; | |
int escPin = 9; | |
int minPulseRate = 1000; | |
int maxPulseRate = 2000; | |
int throttleChangeDelay = 100; | |
void setup() { |
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
#include <IRremote.h> | |
int RECV_PIN = 11; | |
IRrecv irrecv(RECV_PIN); | |
IRsend irsend; | |
boolean recording = true; | |
decode_results results; |
NewerOlder