Files and Folders Flashcards

1
Q

Create a folder in D:\Temp\ with name “Test Folder”

A

New-Item -Path ‘D:\temp\Test Folder’ -ItemType Directory

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

Create a file in D:\Temp\Test Folder with name “Test File.txt”

A

New-Item -Path ‘D:\temp\Test Folder\Test File.txt’ -ItemType File

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

Copy a folder D:\Temp\Test Folder as D:\Temp\Test Folder1

A

Copy-Item ‘D:\temp\Test Folder’ ‘D:\temp\Test Folder1’

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

Copy a folder recursively D:\Temp\Test Folder to D:\Temp\Test Folder1

A

Copy-Item ‘D:\temp\Test Folder’ -Destination ‘D:\temp\Test Folder1’

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

Copy a folder D:\Temp\Test Folder\Test File.txt to D:\Temp\Test Folder1

A

Copy-Item ‘D:\temp\Test Folder\Test File.txt’ ‘D:\temp\Test Folder1\Test File1.txt’

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

Copy all text file recursively D:\Temp\Test Folder to D:\Temp\Test Folder1

A

Copy-Item -Filter *.txt -Path ‘D:\temp\Test Folder’ -Recurse -Destination ‘D:\temp\Test Folder1’

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

Delete a folder D:\Temp\Test Folder1

A

Remove-Item ‘D:\temp\Test Folder1’

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

Remove the folder D:\Temp\Test Folder1 recursively

A

Remove-Item ‘D:\temp\Test Folder’ -Recurse

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

Delete a file D:\Temp\Test Folder\Test.txt

A

Remove-Item ‘D:\temp\Test Folder\test.txt’

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

Remove the folder D:\Temp\Test Folder recursively deleting its all files

A

Remove-Item ‘D:\temp\Test Folder’ -Recurse

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

Move a folder D:\Temp\Test to D:\Temp\Test1

A

Move-Item D:\temp\Test D:\temp\Test1

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

Move a folder D:\Temp\Test\Test.txt to D:\Temp\Test1

A

Move-Item D:\temp\Test\Test.txt D:\temp\Test1

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

Rename a folder D:\Temp\Test to D:\Temp\Test1

A

Rename-Item “D:\temp\Test Test1”

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

Rename a folder D:\Temp\Test\test.txt to test1.txt

A

Rename-Item D:\temp\Test\test.txt test1.txt

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

Read a file D:\Temp\Test\Test.txt

A

Get-Content D:\temp\Test\test.txt

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

Read the size of the content of the file read

A

(Get-Content D:\temp\test\test.txt).length

17
Q

Check existence of folder D:\temp\test

A

Test-Path D:\temp\test

18
Q

Check existence of file D:\temp\test\test.txt

A

Test-Path D:\temp\test\test.txt