PowerShell Flashcards

1
Q

What is the command to change computer name?

A

Rename-Computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the command to restart the computer?

A

Restart-Computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the command to get a list of windows features?

A

Get-WindowsFeature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the command to install and uninstall windows feature?

A

Install-WindowsFeature

Uninstall-WindowsFeature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the command to remove a feature and its payload path?

A

Uninstall-WindowsFeature -Remove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the command to remove all features and payloads not installed?

A

Get-WindowsFeature | Where-Object {$._Installed -eq $false} | Uninstall-WindowsFeature -Remove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the command to configure IP address?

A

New-NetIPAddress -InterfaceIndex/Alias (-AddressFamily) -IPAddress -DefaultGateway -PrefixLength

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the command to configure DNS?

A

Set-DNSClientServerAddress -InterfaceIndex/Alias -ServerAddresses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the command to get a list on IP interfaces?

A

Get-NetIPInterface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the command to add a computer to a domain?

A

Add-Computer -DomainName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the command to get a list of computers connected to a domain?

A

Get-ADComputer -Filter *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the command to disable the firewall completely?

A

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the command to create a firewall rule?

A

New-NetFirewallRule -Name -Direction Inbound/Outbound -Action Block/Allow -Protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the command to add the GUI interface?

A

Install-WindowsFeature -Server-Gui-Mgmt-Infra, Server-Gui-Shell -Source:wim:D:\sources\install.wim:1/2/3/4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the command to see cmdlets within load balancing fail-over?

A

Get-Command -Module Netlbfo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the command to create a new nic team?

A

New-NetlbfoTeam -Name -TeamMembers -TeamingMode -LoadBalancingAlgorithm

17
Q

What is the command to see cmdlets within service?

A

Get-Command -Noun Service

18
Q

What is the command to copy an item and paste it?

A

Copy-Item -Path -Destination

19
Q

What is the command to copy an item and make it not read-only?

A

Copy-Item -Path -Destination -PassThru | Set-ItemProperty -Name IsReadOnly -Value $False

20
Q

What is the command to create a new folder?

A

New-Item -Type Directory -Name -Path

21
Q

What is the command to see images (index) within a wim file?

A

Get-WindowsImage -ImagePath

22
Q

What is the command to mount a wim image?

A

Mount-WindowsImage -ImagePath -Path -Index

23
Q

What is the command to unmount a wim image?

A

Dismount-WindowsImage -Path

24
Q

How do you create a configurtion?

A
In a ps1 script:
Configuration  {
          Node "COMPUTER" {
                    WindowsFeature  {
                              Name = ''
                              Ensure = 'Present'
                    }
          }
}
25
Q

How do you deploy a script?

A
# Generate the .MOF file
ConfigurationName -OutputPath c:\
# Push the .MOF to computer
Start-DscConfiguration -Path c:\ -Wait -Verbose
26
Q

What is the command to see cmdlets within desired state configuration?

A

Get-DscResource

27
Q

What are the main components of a PowerShell DSC configuration script?

A

Configuration
Node
Resource