PowerShell file operation
Files
Renaming files [replacing specific chars in files]
rename files, replacing any old_value with new_value
List the files in a directory and recurse replace old_value with new_value
Replace file/folder name value from old_value to new_value
Get file full path
Get full file path recursively from a directory, where the file extension is .md
get-childitem "C:\temp\test_folder" -recurse | where {$_.extension -eq ".md"} | % {Write-Host $_.FullName}
another way of doing it
Create a file
create a file in D:\Temp\Test Folder with name "Test File.txt"
Check file existence
check if file test.txt exists in 'D:\temp\test directory'
Retrieving Item
reading a file's content 'D:\Temp\Test\Test.txt'
Renaming a file
rename file test.txt to test1.txt
Moving a file
move a file from one directory to another 'D:\Temp\Test\Test.txt' to 'D:\Temp\Test1'
Deleting file(s)
Copying file(s)
Folders
create a folder
create a folder in D:\Temp\ with name "Test Folder"
Copying a folder
Renaming a folder
renaming a folder D:\Temp\Test to D:\Temp\Test1
moving a folder
move a folder D:\Temp\Test to D:\Temp\Test1
Deleting a folder
Check folder existence
Check if path exists 'D:\temp\test'