2024: A Landmark Year for Global Crypto Regulation
A to Z Full Forms and Acronyms

PowerShell Scripts

Nov 20, 2021 PowerShell, 4757 Views
PowerShell Scripts on Files and Folders

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
A to Z Full Forms and Acronyms
SUBHAM RAY

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.

Related Article

Cookies.

By using this website, you automatically accept that we use cookies. What for?

Understood