Tuesday, November 28, 2017

Windows 10 PowerShell Reference Guide

Course 20697-1 Implementing and Managing Windows 10

Module 3

Get-ExecutionPolicy

Set-ExecutionPolicy Unrestricted

Get-PrinterProperty –PrinterName “HP Photosmart 7520”
Note
: The property named Config:DuplexUnit is set to TRUE.

Set-PrinterProperty –PrinterName “HP Photosmart 7520” –PropertyName “Config:DuplexUnit” –Value FALSE
Note:
You must use all caps for the TRUE or FALSE values.

Get-PrinterProperty –PrinterName “HP Photosmart 7520”
Note:
The property named Config:DuplexUnit is now FALSE.

# *** Answer *** List Running Services in Green

$services = get-service

foreach ($service in $services) {

    if ($service.status –eq “Running”) {

        $color = “Green” }

    Else {

        $color = “Red” }

    write-host $service.Name “ – “ $service.Status –ForegroundColor $color

}

write-host “A total of “ $services.count “services were evaluated”

write-host “Script execution is complete” –ForegroundColor gray –BackgroundColor Black

Additional Notes Try …

$services | Group-Object -Property status

Module 4

Get-NetIPAddress

test-connection LON-DC1

Get-DnsClientCache

Clear-DnsClientCache

test-connection www

Get-DnsClientCache | fl

Resolve-Dnsname LON-DC1 | fl

Module 5

$MaxSize = (Get-PartitionSupportedSize –DriveLetter e).sizeMax
Resize-Partition –DriveLetter e –Size $MaxSize

Clear-Disk –Number 1 –RemoveData
Note: Delete all partitions from disk

Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR

Module 6

Install-WindowsFeature FS-SyncShareService
Note: After the feature installs, you will receive a warning message because Windows automatic updating is not enabled. You can ignore the warning.

Module 7

add-appxpackage \\lon-dc1\apps\app1.appx

Module 8

Sorry but no noteworthy PowerShell

Module 9

Invoke-Gpupdate –force

Module 10

Run Get-NetIPsecMainModeSA

Note: To examine the Main Mode Security Associations (SAs), at the Windows PowerShell prompt, type the following cmdlet, and then press Enter:
Get-NetIPsecMainModeSA

Run Get-NetIPsecQuickModeSA

Note: To examine the Quick Mode SAs, at the Windows PowerShell prompt, type the following cmdlet, and then press Enter:
Get-NetIPsecQuickModeSA

Module 11

Sorry but no noteworthy PowerShell

Module 12

Sorry but no noteworthy PowerShell