Powershell Flashcards

1
Q

Redirect the output of a file

A

dir c:\file1 > file2

File1&raquo_space; file2

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

Display a directory

A

Get-childitem-directory
dir
Ls

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

Display history

A

Get-history
H
ghy

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

Create a new file

A

New-item
Note pad file1

Leafpad file1

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

What command displays only directorys

A

Get-childitem -directory

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

Copy commands

A

Copy-item file1.txt ./dir1/

Copy file1.txt ./dir1/file1.txt

Cp file1 ./dir1/

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

Add and remove a permission

A

attrib +h file1

attrib -h file1

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

What are the permissions switches

A
N deny all access 
F allow full access 
M modify access 
RX read/ execute access 
R read only 
W wright only 
D remove user or group for no access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Display command in GUI

A

Show-command

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

Change a file property

A

Set-itemproperty file1.txt -name isReasOnly -value $false

Set-itemproperty file1.txt -name isReasOnly -value $true

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

Stride threat model

A
Spoofing 
Tampering with data 
Repudiation 
Information disclosure 
Denial of service 
Elevation of services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Authentication vs Authorization

A

Authentication is (who you are) verifying the identity of the user and authorization is (what you can do) determining users access privileges

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

Get help

A

Get-help *
Get-help get-acl

Help command

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

Execute your profile

A
Set-executionPolicy remoteSigned
Or
Get execution
Set execution 
RemoteSigned
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Get a list of all the commands

A

Get-command | more

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

Create a link

A

Mklink targetFile.bak sourceFile.txt

17
Q

Count things in a file

A

Get-content file1 | measure-object

  • line
  • character
  • word
18
Q

Start an instance of notepad

A

Start-process notepad

19
Q

Cancel a process

A

Get-process -name notepad

Stop-process processID

20
Q

Sort by stuff

A

Get-content file1 | sort -descending

21
Q

Display all environment variables

A

Echo $env:path; $env:computername

22
Q

How can an admin see all aliases?

A

Get-alias | more

23
Q

String operators

A
  • eq equals
  • ne not equal
  • le less then or equal
  • ge greater then or equal
  • lt less the.
  • gt greater then
  • like wildcard for strings
  • not like wildcard comparison 4 string
24
Q

Display not duplicates

A

Get-content file1 | get-unique

25
Q

What does acl stand for?

A

Access control list

26
Q

Find the value of a variable

A

Get-variable -name value