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
$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
{ | |
"$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
<# | |
.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 |
OlderNewer