Disable and Enable Features Using Dism

Dism- Deployment Image Servicing and Management used to service a windows image (.wim) or a virtual hard disk. It can be also used to enable and disable features in windows. Start the cmd as administrator and supply below commands- #It gives the list of all features C:Windows\system32>Dism /online /Get-Features #It enable the feature C:Windows\system32>Dism /online … Continue reading Disable and Enable Features Using Dism

Reading and Writing Text File using PowerShell

Here I am listing some of the common cmdlets which help to operate with text file- How to create text file using PowerShell? New-Item <File Path> How to open text file or any folder sturcture using PowerShell? Invoke-Item <File Path> How to add or append contents in text file using PowerShell? Add-Content <File Path> Text … Continue reading Reading and Writing Text File using PowerShell

How to create generation 2 virtual machine using PowerShell?

Below script would help to create virtual machine in Hyper-V using PowerShell- Open PowerShell window as admin. Paste below script and hit enter. VM would be created. Open Hyper-V Manager and verify it. # Set VM Name, Switch Name, and Installation Media Path. $VMName = ‘TestVM’ # Switch is nothing but network adapter $Switch = … Continue reading How to create generation 2 virtual machine using PowerShell?