🕵️♂️
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
#obatined from: https://gallery.technet.microsoft.com/scriptcenter/Convert-SubnetMask-80401493 | |
<# | |
.SYNOPSIS | |
Converts between PrefixLength and subnet mask. | |
.DESCRIPTION | |
This script converts between PrefixLength and subnet mask parameters, these parameters define the size of a subnet for IPv4 addresses. | |
This script assumes valid subnet mask input and does not support scenarios such as non-contiguous subnet masks. | |
.INPUTS | |
None | |
.OUTPUTS |
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 | |
Get-Config function will pull in needed data from config file | |
.DESCRIPTION | |
Get-Config function will pull in needed data from config file. | |
#> | |
function Get-Config { | |
#specify the location of the config file | |
$csv = Import-Clixml -Path "C:\HypQC_Config.xml" | |
#Read the XML config file and load data into variables |
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
@{Label=”Length”;Expression={'{0:N0}’ –F ($_.Length/1GB)}} | sort Length -Descending | ft -AutoSize |
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
Invoke-Command $dedicatedserversession - filepath C:\path\test2.ps1 | |
Invoke-Command $nodes -ScriptBlock ${function:get-thename} |
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
$freeMemory = [math]::round($w32OSInfo.FreePhysicalMemory /1MB, 0) | |
$intSize = [math]::round($intSize / 1GB, 0) |
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
#------------------------------------------------------ | |
#check currently installed roles | |
Get-WindowsFeature | where {$_.installed -eq "True"} | |
#------------------------------------------------------ | |
#------------------------------------------------------ | |
#install the Hyper-V Role | |
Install-WindowsFeature Hyper-V -IncludeManagementTools -Restart -Verbose | |
#------------------------------------------------------ |
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 Get-NetworkStatistics { | |
<# | |
.SYNOPSIS | |
Display current TCP/IP connections for local or remote system | |
.FUNCTIONALITY | |
Computers | |
.DESCRIPTION | |
Display current TCP/IP connections for local or remote system. Includes the process ID (PID) and process name for each connection. |
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
Get-WmiObject -class Win32_Volume -computername localhost | where-object {$_.name -like "\\?\*"} | select-object Label,DriveLetter,DeviceID,SystemVolume,name,Capacity,Freespace | format-list | |
#also | |
mountvol.exe |
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
#ERASE ALL THIS AND PUT XAML BELOW between the @" "@ | |
$inputXML = @" | |
<Window x:Name="Diag_V" x:Class="MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:Diag_V" | |
mc:Ignorable="d" | |
Title="Diag-V" Height="350" Width="525"> |
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
#--------------------------------------------------------------------- | |
#get WMI data loaded up | |
#-------------------------------------------------------------------- | |
try{ | |
$w32ProcInfo = Get-WmiObject -Namespace "root\cimv2" -Class win32_processor -Impersonation 3 -ComputerName $node | |
$w32OSInfo = Get-WmiObject -Namespace "root\cimv2" -Class Win32_OperatingSystem -Impersonation 3 -ComputerName $node | |
} | |
catch{ | |
Write-Host "An error was encountered getting WMI info from $node" -ForegroundColor Red | |
Write-Error $_ |
OlderNewer