Yet times, we need to create temporary files in PowerShell scripts to store the temporary data for the program’s need. These files are created in the temporary folder which was set in the Operating System configuration. PowerShell provides New-TemporaryFile cmdlet to do the job for us to create a temporary file(s) through the scripts. Create […]
PowerShell – How to display and open Control Panel items?
Usually, we open control panel items from the Control Panel. Sometimes it is required to open them through the commands or APIs and PowerShell provides useful commands to display the control panel items and allows to open them. Note that, some control panel items will appear only when the right hardware is detected; with that, […]
PowerShell – How to enable or disable network adapters?
PowerShell provides a set of cmdlets to enable or disable network adapters. These cmdlets we are going to discuss through this article, are in NetAdapter module. Enable a network adapter Enable-NetAdapter cmdlet enables a network adapter. To connect to the network, network adapters must be enabled. Through its’ -Name the parameter we can pass the […]
PowerShell – How to get network adapter details?
PowerShell provides a bunch of cmdlets through the NetAdapter module to manage network adapters. Through this article, we are going to discuss how we get the network adapter details, properties, etc, using PowerShell cmdlet(s). Get-NetAdapter is to get the details/properties of the network adapter. The below command shows the basic details of the network adapter. PS […]
PowerShell – How to unzip files?
In our previous article, we have discussed about zip / compress the selected files or directories using PowerShell Compress-Archive cmdlet. Through this article, we are going to discuss how to unzip the zipped files. Expand-Archive cmdlet – Unzip files from Archived file(s) PowerShell provides Expand-Archive cmdlet to unzip the zipped files. Through its -Path argument […]
Powershell – How to zip / compress / archive selected files or directories?
Windows PowerShell provides commands to zip (compress) and unzip the files. Through this article, we are going to discuss the PowerShell command to zip the selected files or directories. Compress-Archive cmdlet – Compress / Zip / Archive the selected files or directories PowerShell provides Compress-Archive cmdlet, to archive the specified files or directories. We can […]
PowerShell – Operator Precedence
We use Arithmetic Operators in the expressions to calculate numeric values. PowerShell processes these expressions from left to right, and depending on the order of precedence expressions are evaluated. Operators who have higher precedence will evaluate first. To understand operator precedence, let’s take a simple arithmetic expression; 3+4/7*10-2%3+20 When we evaluate the above expression from […]
PowerShell – Exception handling
PowerShell provides exception handling mechanism to enable to deal with the exceptions raised during the script execution. Known or expected errors, we commonly handle using Error handling mechanism; where mostly we use if statement to meet certain criteria and the change the flow of execution depends on the result of the conditional statement. Exceptional handling […]
PowerShell – How to access Clipboard?
Clipboard is a buffer in computer memory, allows the applications to copy and retrieve the temporary data. Most of the applications provides the Clipboard feature to share the temporary data across the applications. Most common way we can use the Clipboard is using cut, copy and paste commands. PowerShell provides cmdlets to use the Clipboard. […]
PowerShell – Type operators
PowerShell Type operators are used to verify the type of the operand. Are you aware, each value we use in PowerShell has particular Type? These are the types similar to the types defined in .Net. Yes, because PowerShell is developed using .Net Framework. These operators are allowed to verify the type of the operand. Through […]