PowerShell

PowerShell Scripts

PowerShell Scripts

PowerShell Scripts on Files and Folders

PowerShell - To Create a Folder

Command - New-Item is used to create a directory and passing -ItemType as Directory

New-Item -Path 'D:\NewFolder\TutorialsLink' -ItemType Directory

PowerShell - To Create a File

Command - New-Item is used to create a file and passing -ItemType as File

New-Item -Path 'D:\NewFolder\TutorialsLink\File.txt' -ItemType File

PowerShell - To Copy a directory

Command - Copy-Item is used to copy a directory to a different directory

Copy-Item 'D:\NewFolder\TutorialsLink' 'D:\NewFolder2\TutorialsLink2'

PowerShell - To copy a File

Command - Copy-Item is used to copy a file from a directory to another

Copy-Item 'D:\NewFolder\TutorialsLink\File.txt' 'D:\NewFolder2\TutorialsLink2\File2.txt'

PowerShell - To Check a folder existence

Command - Test-Path is used to check the existence of a folder

Test-Path D:\TutorialsLink\Folder
SUBHAM RAY

Subham Ray loves to share Technology through articles or sessions or even Virtual events. He is a passionate Author at TutorialsLink where he writes articles on Azure , data science, Machine Learning, and more. He is a certified Artificial Intelligence Engineer. He has delivered sessions on technology on national and international grounds.