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-help "command name" | |
get-member "command name | get-member" | |
help |
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-Windows Feature -name AD* |
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-WindowsFeature AD-Domain-Services | Install-WindowsFeature |
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-Command -Module ADDS* | |
GEt-Help *adds* |
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-help Install-ADDSForest -Examples | |
Install-ADDSForest -DomainName 'company.local' -InstallDNS |
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
1..254 | ForEach-Object { | |
if(!(Test-Connection 10.0.100.$_ -count 1 -Quiet)) { | |
Write-Output "IP Address Available 10.0.100.$_" | |
} | |
else { | |
Write-Output "IP Address in use 10.0.100.$_" | |
} | |
} |
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
$Vlan = 1..3 | ForEach-Object { | |
if(!(Test-Connection 10.0.100.$_ -count 1 -Quiet)) { | |
[pscustomobject]@{Name = "Available"; Value = "10.0.100.$_"} | |
} | |
else { | |
[pscustomobject]@{Name = "Not Available"; Value = "10.0.100.$_"} | |
} | |
} |
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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") | |
. "$here\$sut" | |
Describe "Get-LocalNIC" { | |
It "makes sure there is a NIC with the Wi-Fi name present" { | |
Get-LocalNICName | Should Be 'Wi-Fi' | |
} | |
It "returns the MTU size = 1500" { |
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-LocalNICName { | |
(Get-NetAdapter | Where-Object { $_.Name -eq 'Wi-Fi'}).Name | |
} | |
function Get-LocalNICMTUSize ($name) { | |
(Get-NetAdapter -Name $name).MtuSize | |
} | |
function Get-LocalNICFullDuplex ($name) { | |
(Get-NetAdapter -Name $name).FullDuplex |
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
# you can replace this with list of servers | |
#$computers = 1..5 this was for testing purposes | |
$computers = Get-Content C:\Scripts\test.txt | |
#Define variable | |
$DellSystemInfo = $Null | |
foreach ($node in $computers){ | |
# Get Dell Server serviceTag | |
$ServiceTag1 =(Get-CimInstance -ComputerName $node -ClassName Win32_ComputerSystemProduct).identifyingNumber |
OlderNewer