How you can create and move files and folders with PowerShell

I have started writing about many PowerShell scripts in my blog after I get the request from many frequent blog followers who are connected with me on the various social platforms. Today I will show you how you can create files in Powershell.
You can create a file with the following command.
New-Item

This below command will create a directory or folder.

If you want to move items, use the move item command
Move-Item

Here is the command

Get-Item C:\PowerShell\aaviScripts\VMEncryptionStatusQAUDP.ps1 | Move-Item -Destination E:\
 
If you want to replace the file you can use the below command.


Get-Item C:\PowerShell\aaviScripts\VMEncryptionStatusQAUDP.ps1 | Move-Item -Destination E:\ -Force
If you want to add some text

If you want to see the size of the files.

If you want to get the child Items with additional filter use this command

This will also work.

That’s all for today with PowerShell I hope you like this post. Have a good day ahead.

 

0.00 avg. rating (0% score) - 0 votes