- Trending Categories
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](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
2K+ Views
To copy the items with the different credentials you need to use the credential parameter in the Copy-Item cmdlet.For example,Copy-Item C:\temp\* -Destination \Remoteshare\c$\temp -Credential (Get- Credential)Or$creds = (Get-Credential) Copy-Item C:\temp\* -Destination \Remoteshare\c$\temp -Credential $creds
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
2K+ Views
Now it is easy to ZIP or extract (unzip) the files or folders using PowerShell. PowerShell has added features of the Archive module (Microsoft.PowerShell.Archive) from PowerShell 5.1 version.If you have PowerShell older version (version 4.0 or less) then you can download and install the module from the website or through ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
3K+ Views
When you are writing a script and if you want to provide the user to select one option among multiple values and based on it to execute the command, we can generally use the Switch command and for it, we will ask the user choice in the below script.There is ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
10K+ Views
SSL certificates are a very crucial part of the website. They play a key role in securing the exchange of information on both client and server sides by activating an HTTPS secure connection. In the below article with the PowerShell, we will get the certificate validity date (starting and expiry ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
7K+ Views
Try/Catch block in PowerShell is to handle the errors which are produced in the script. To be specific, the errors should be terminating errors. The Finally block in the PowerShell is not mandatory to write each time along with Try/Catch but it will be executed regardless the error occurs or ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
8K+ Views
Like ErrorActionPreference variable, ErrorAction parameter works similarly. ErrorAction parameter supported in Advance functions and most of the built-in cmdlets in PowerShell. It is useful to convert the non-terminating error to the terminating error and then you can handle them with try/catch blocks.Supported Values and Examples, Continue − This is the ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
5K+ Views
ErrorActionPreference variable in PowerShell is to control the non-terminating errors by converting them to terminating errors. Error handling depends upon which value you assign to $ErrorActionPreference variable.The values are as below.Continue − This is the default value of the variable and when the error occurs, an error is displayed in ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
1K+ Views
Powershell generates two types of errors when it executes script or commands. Terminating errors and Non-Terminating errors.Terminating error − This error generated by script, functions, or commands you create and it stops or halts the execution of the script so that the commands in the next lines can’t be executed. ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
3K+ Views
Error variable in PowerShell is to view the errors generated in the current PowerShell session. We can say that the $Error variable is the container that stores all the errors and the latest error will be displayed first. For the example below, we will set the $Errorview to Category view ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
6K+ Views
$LastExitCode in Powershell is the number that represents the exit code/error level of the last script or application executed and $? (Dollar hook) also represents the success or the failure of the last command. In general, both represent the same but the output method is different. The first command output ... Read More