This file contains hidden or 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
(gwmi Win32_Operatingsystem).Caption |
This file contains hidden or 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
$ENV:PATH = $ENV:PATH + ";C:\Windows\System32" |
This file contains hidden or 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 Foo | |
{ | |
Param( | |
[ValidateSet("Tom","Dick","Jane")] | |
[String]$Name, | |
[ValidateRange(21,65)] | |
[Int]$Age, | |
[ValidateScript({Test-Path $_ -PathType 'Container'})] |
This file contains hidden or 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 win32_SystemEnclosure | select serialnumber |
This file contains hidden or 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
gwmi Win32_Product -Filter 'Name like "%vCenter%"' | % { $_.uninstall() } |
This file contains hidden or 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
# Test Jumbo frames (with VLAN) | |
vmkping -d -s 8972 x.x.x.x | |
# Test Jumbo frames (without VLAN) | |
vmkping -d -s 8968 x.x.x.x | |
# Test interface | |
vmkping -I vmkX x.x.x.x |
This file contains hidden or 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
foreach ($server in $serverNames) | |
{ | |
Get-WMIObject Win32_Process -Filter 'name="explorer.exe"' -ComputerName $server -PipelineVariable pipedProcess -ErrorAction SilentlyContinue | | |
Select CSName, @{ Name='User'; Expression={$pipedProcess.GetOwner().User} } | | |
Write-Output -OutVariable +loggedOnUsers | |
} |
This file contains hidden or 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
$Shell = New-Object -ComObject Shell.Application | |
$RecBin = $Shell.Namespace(0xA) | |
$RecBin.Items() | %{Remove-Item $_.Path -Recurse -Confirm:$false} |
This file contains hidden or 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-CimInstance -ClassName win32_group ` | |
-Filter "Name LIKE 'admin%' AND Domain = '$env:COMPUTERNAME'" | | |
Get-CimAssociatedInstance -Association win32_groupuser | | |
Select-Object -ExpandProperty Name |
This file contains hidden or 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
$replaceUmlaut = { | |
param ($Match) | |
$characterMap = New-Object System.Collections.Hashtable | |
$characterMap.ä = 'ae' | |
$characterMap.ö = 'oe' | |
$characterMap.ü = 'ue' | |
$characterMap.ß = 'ss' | |
$characterMap.Ä = 'Ae' | |
$characterMap.Ü = 'Ue' | |
$characterMap.Ö = 'Oe' |
OlderNewer