Files and Folders Flashcards
Create a folder in D:\Temp\ with name “Test Folder”
New-Item -Path ‘D:\temp\Test Folder’ -ItemType Directory
Create a file in D:\Temp\Test Folder with name “Test File.txt”
New-Item -Path ‘D:\temp\Test Folder\Test File.txt’ -ItemType File
Copy a folder D:\Temp\Test Folder as D:\Temp\Test Folder1
Copy-Item ‘D:\temp\Test Folder’ ‘D:\temp\Test Folder1’
Copy a folder recursively D:\Temp\Test Folder to D:\Temp\Test Folder1
Copy-Item ‘D:\temp\Test Folder’ -Destination ‘D:\temp\Test Folder1’
Copy a folder D:\Temp\Test Folder\Test File.txt to D:\Temp\Test Folder1
Copy-Item ‘D:\temp\Test Folder\Test File.txt’ ‘D:\temp\Test Folder1\Test File1.txt’
Copy all text file recursively D:\Temp\Test Folder to D:\Temp\Test Folder1
Copy-Item -Filter *.txt -Path ‘D:\temp\Test Folder’ -Recurse -Destination ‘D:\temp\Test Folder1’
Delete a folder D:\Temp\Test Folder1
Remove-Item ‘D:\temp\Test Folder1’
Remove the folder D:\Temp\Test Folder1 recursively
Remove-Item ‘D:\temp\Test Folder’ -Recurse
Delete a file D:\Temp\Test Folder\Test.txt
Remove-Item ‘D:\temp\Test Folder\test.txt’
Remove the folder D:\Temp\Test Folder recursively deleting its all files
Remove-Item ‘D:\temp\Test Folder’ -Recurse
Move a folder D:\Temp\Test to D:\Temp\Test1
Move-Item D:\temp\Test D:\temp\Test1
Move a folder D:\Temp\Test\Test.txt to D:\Temp\Test1
Move-Item D:\temp\Test\Test.txt D:\temp\Test1
Rename a folder D:\Temp\Test to D:\Temp\Test1
Rename-Item “D:\temp\Test Test1”
Rename a folder D:\Temp\Test\test.txt to test1.txt
Rename-Item D:\temp\Test\test.txt test1.txt
Read a file D:\Temp\Test\Test.txt
Get-Content D:\temp\Test\test.txt