View Format-Prefix.ps1
#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 |
View Get-Config.ps1
<# | |
.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 |
View Invoke-Command.ps1
Invoke-Command $dedicatedserversession - filepath C:\path\test2.ps1 | |
Invoke-Command $nodes -ScriptBlock ${function:get-thename} |
View Custom-Label
@{Label=”Length”;Expression={'{0:N0}’ –F ($_.Length/1GB)}} | sort Length -Descending | ft -AutoSize |
View ConvertToGB.ps1
$freeMemory = [math]::round($w32OSInfo.FreePhysicalMemory /1MB, 0) | |
$intSize = [math]::round($intSize / 1GB, 0) |
View ClusterDetect.ps1
<# | |
.Synopsis | |
Evaluates if local device is a member of a cluster or a standalone server | |
.DESCRIPTION | |
Evaluates several factors to determine if device is a member of a cluster or acting as a standalone server. The cluster service is evaluated, and if present the cluster nodes will be tested to determine if the local device is a member. If the cluster service is not running the cluster registry location is evaluated to determine if the server's cluster membership status. | |
.EXAMPLE | |
Test-IsACluster | |
Returns boolean if local device is part of a cluster | |
.OUTPUTS |
View Hyper-V_Misc.ps1
#------------------------------------------------------ | |
#check currently installed roles | |
Get-WindowsFeature | where {$_.installed -eq "True"} | |
#------------------------------------------------------ | |
#------------------------------------------------------ | |
#install the Hyper-V Role | |
Install-WindowsFeature Hyper-V -IncludeManagementTools -Restart -Verbose | |
#------------------------------------------------------ |
View Get-NetworkStatistics.ps1
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. |
View Get-VolumeGUID.ps1
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 |
View PSGUI.ps1
#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"> |
OlderNewer