- 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
3K+ Views
To check if the PSCustomObject is empty or not in PowerShell, we need to check the fields of the PSCustomObject. Consider the below example, Example$output = [PSCustomObject]@{ Name = 'John' City = 'New York' Country = 'US' Company = 'Alpha' } $output1 = [PSCustomObject]@{ Name = '' ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
3K+ Views
If you want to delete the entire text file content using PowerShell, then we can use the Clear-Content command. For example, we have the below text file called Locations.txt on the C:\Temp path. You can check the content using the below file.Get-Content C:\temp\locations.txtTo clear the file content, we can use ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
12K+ Views
To get the installed windows updates using PowerShell, we can use the Get-Hotfix command. This command gets the hotfixes and updates that are installed on the local and the remote computer.This command is the part of Microsoft.Management.PowerShell utility.ExampleGet-HotFixOutputPS C:\> Get-HotFix Source Description HotFixID InstalledBy InstalledOn ------ ----------- -------- ----------- ----------- ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
558 Views
Test-Path command checks if the particular path exists or not and returns the Boolean output (True or False) while Resolve-Path command displays the particular directory if exists otherwise throws an exception. For example, For the path to exist, ExamplePS C:\> Test-Path C:\Temp\ True PS C:\> Resolve-Path C:\Temp\ Path ---- C:\Temp\For ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
5K+ Views
To browse through the registry in PowerShell, we can use the Get-ChildItem command. For example to get all keys from the path HKLM:\Hardware we can use the below command.Get-ChildItem HKLM:\HARDWAREOr you can set the location and use the dir (get-ChildItem or ls) command to browse the path.ExamplePS C:\> Set-Location HKLM:\HARDWARE PS HKLM:\HARDWARE> dirOutputHive: HKEY_LOCAL_MACHINE\HARDWARE Name Property ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
10K+ Views
To delete the registry key value using PowerShell, we can use the Remove-ItemProperty command. Suppose we have the registry NodeSoftware and its Property is AppSecurity. We need to delete its key using the Remove-ItemProperty command.PS C:\> Get-Item HKLM:\SOFTWARE\NodeSoftware Hive: HKEY_LOCAL_MACHINE\SOFTWARE Name Property ---- -------- NodeSoftware AppSecurity : 1To delete the ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
3K+ Views
Transport Layer Security known as TLS is a very important part while using URI commands such as Invoke−WebRequest or Invoke−Restmethod commands and package commands such as Find−Package or Install−Package because they interact on the internet and PowerShell needs TLS1.2 version for that.We may get the below errors when we use ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
9K+ Views
Tree command graphically shows the folder structure of the given drive or a path. It is similar to Get−ChildItem or dir recursive command except this shows the graphical structure. For example, the below command will retrieve the folder structure of C:\VMs includingtree c:\VMsOutputThere are also two other switches supported for ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
5K+ Views
PowerShell 7 supports the -AsHashtable parameter in the ConvertFrom−JSON command to convert the JSON to hashtable directly and that is a great feature. Consider we have the below JSON file, We can use the pipeline command ConvertFrom−JSON to convert the JSON file to the custom table format and with the ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
3K+ Views
To mount the ISO file in Windows using PowerShell, we can use the Mount−DiskImage command. The below command will mount the image file stored at the C:\ISO location.Mount−DiskImage −ImagePath "C:\ISOs\Windows_Server_2016_Datacenter_EVAL_en−us_14393_refresh (1).ISO"OutputAttached : True BlockSize : 0 DevicePath : \.\CDROM0 FileSize : 6972221440 ImagePath : C:\ISOs\Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh (1).ISO LogicalSectorSize : 2048 Number ... Read More