- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Chirag Nagrekar has Published 465 Articles
Chirag Nagrekar
3K+ Views
To copy files or folders to or from the remote location, you need to provide the UNC path of the items. For example, here we are going to copy a file from the local computer to a remote computer called Test-PC.Copy-Item D:\Temp\PowerShellcommands.csv -Destination \Test- PC\Sharedpath\PScommands.ps1 -PassThruHere, file PowerShellcommands.csv is copied ... Read More
Chirag Nagrekar
4K+ Views
To copy the files with the specific extension, you need to use the Get-ChildItem command. Through the Get-ChildItem you first need to retrieve the files with the specific extension(s) and then you need to pipeline Copy-Item command.Here, we need to copy *.txt files from the source to the destination location.First, ... Read More
Chirag Nagrekar
2K+ Views
To copy the readonly and hidden items from one location to another, you need to use the –Force parameter with Copy-Item cmdlet.When you run the command without Force parameter for the readonly/hidden files, you will get the error. An example is given below.ExampleCopy-Item D:\Temp\Readonlyfile.txt -Destination D:\TempContent\OutputPS C:\WINDOWS\system32> Copy-Item D:\Temp\Readonlyfile.txt -Destination ... Read More
Chirag Nagrekar
14K+ Views
To copy the contents of the folder to the destination folder in PowerShell, you need to provide the source and destination path of the folder, but need to make sure that you need to use a wildcard (*) character after the source path, so the entire folder content gets copied.If ... Read More
Chirag Nagrekar
6K+ Views
To copy the multiple files in PowerShell, you need to separate each file with the comma (, ).In the below example, we will copy multiple files from the source to the destination folder D:\TempContent.ExampleCopy-Item .\PowerShellcommands.csv, .\cars.xml -Destination D:\TempContent\ -PassThruOutputPS D:\Temp> Copy-Item .\PowerShellcommands.csv, .\cars.xml -Destination D:\TempContent\ -PassThru Directory: D:\TempContent ... Read More
Chirag Nagrekar
15K+ Views
To copy items in PowerShell, one needs to use the Copy-Item cmdlet. When you use the Copy-Item, you need to provide the source file name and the destination file or folder name.In the below example, we will copy a single file from the D:\Temp to the D:\Temp1 location.ExampleCopy-Item -Path D:\Temp\PowerShellcommands.csv ... Read More
Chirag Nagrekar
265 Views
Copy-Item in PowerShell cmdlet is used for copying items from one location to another location in the same namespace. Here, the namespace meaning, you can copy items from files to the different folders but cannot files to the registry or the certificate store.This cmdlet doesn’t delete or cut the item ... Read More
Chirag Nagrekar
3K+ Views
Adding values of the hash table is simple as the adding string. We just need to use the addition operator (+) to merge two hash table values.Here, we have two hash tables: $htable and $htable1.$htable = [Ordered]@{EmpName="Charlie";City="New York";EmpID="001"} $htable1 = [Ordered]@{Fruit='Apple';Color='Red'}We will now add two hash tables, $htable + $htalble1PS ... Read More
Chirag Nagrekar
2K+ Views
Hash table in the PowerShell session is created temporarily. It is like a variable, when the session is closed, hash table is deleted automatically. If you want to delete all the values from the hash table at once but retaining the hash table variable, you need to use the Clear() ... Read More
Chirag Nagrekar
14K+ Views
You can add values to the hash table and remove values from the hash tables. To add the values to the hash table, you need to use the below format.$hash[""] = ""We have hash table already created here, $htable = [Ordered]@{EmpName="Charlie";City="New York";EmpID="001"}PS C:\WINDOWS\system32> $htable Name Value ---- ... Read More
To Continue Learning Please Login
Login with Google