View friends
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 |
View gist:ad05a04eb96bcfab416f
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* |
View gist:c3f4ab1a8a3f9ce308c5
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 |
View gist:0f3384adf458c3884181
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* |
View gist:c8cac5d93a4c5b11e911
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 |
View AvailableIP1
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.$_" | |
} | |
} |
View IPAddress2
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.$_"} | |
} | |
} |
View gist:4e3b0a6b99953f5f94c0
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" { |
View gist:ada0896791973670c6ac
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 |
View gist:60b95f734f4b5e14a4f7
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