Chirag Nagrekar has Published 465 Articles

How scriptblock works in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 03-Sep-2020 10:56:07

3K+ Views

Scriptblock is a set of commands which can be executed together when they are invoked. In PowerShell, generally, we write individual commands. Scriptblock can be written with two curly brackets.Example$sb = {Get-Process powershell; Get-Service W32Time}Here we have written two commands under scriptblock. If you directly run this command, scriptblock treats ... Read More

How to Copy files or Folder without overwriting existing files?

Chirag Nagrekar

Chirag Nagrekar

Updated on 03-Sep-2020 10:48:21

6K+ Views

To copy files/folders on the remote path without overwriting the existing files/folders, you can use multiple cmdlets like Copy-Item, Robocoy, and Xcopy, etc. As Copy-Item is a standard cmdlet, we will check if it's supported parameters can prevent overwriting.If Copy-Item doesn’t work then we will check its alternate command. Copy-Item ... Read More

How to run PowerShell commands in Background?

Chirag Nagrekar

Chirag Nagrekar

Updated on 03-Sep-2020 10:42:36

13K+ Views

To run commands in the background in the PowerShell, you need to use Background job cmdlets. Background job means running commands/job in the background without occupying the console.Start-Job is one of the job scheduler cmdlets for PowerShell which runs PowerShell commands in the background without interacting with the current user ... Read More

How to use PowerShell Help commands?

Chirag Nagrekar

Chirag Nagrekar

Updated on 26-Aug-2020 08:27:28

4K+ Views

To get help for the particular command, you can use Get-Help (alias: help)  cmdlet with the command that you need help.For example, help Get-ServiceOnce you run this command, you will get the description of NAME, SYNOPSIS, SYNTAX, DESCRIPTION, RELATED LINKS, and REMARKS.Multiple parameters that support help as shown below-Full − ... Read More

How to remove windows features using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 26-Aug-2020 08:25:27

3K+ Views

To remove windows features, we can use command Remove-WindowsFeature command is used along with feature name.Remove-WindowsFeature Search-Service -VerboseVERBOSE: Uninstallation started... VERBOSE: Continue with removal? VERBOSE: Prerequisite processing started... VERBOSE: Prerequisite processing succeeded. Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {Windows Search Service} VERBOSE: ... Read More

How to Install Windows Features with PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 26-Aug-2020 08:23:44

5K+ Views

To install windows features on the server, Install-WindowsFeature cmdlet is used .Install-WindowsFeature Windows-Server-Backup -LogPath C:\Temp\Installfeatures.txt -VerboseIn the above example, Windows-Server-Backup feature will be installed on the local server and logs will be stored at location C:\Temp and file name InstallFeatures.txt.PS C:\Users\Administrator> Install-WindowsFeature Windows-Server-Backup -LogPath C:\Temp\Installfeatures.txt -Verbose VERBOSE: Installation started... VERBOSE: ... Read More

How to Get Windows features using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 26-Aug-2020 08:19:14

10K+ Views

To get the windows features and roles available or installed using PowerShell, you need to use the Get-WIndowsFeature cmdlet. That is obvious that Windows features and roles are available only on the server operating systems not on the client operating system.When you run the Get-WindowsFeature on the server operating system ... Read More

How to uninstall software using Package management in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 08-Aug-2020 07:45:00

3K+ Views

There are mainly 3 methods by which you can uninstall software using PowerShell.WMI Method.Using Package providerUninstallation String.Here, we will discuss the method to uninstall software using Package management.You can uninstall the software or packages which are installed with the package providers. You can get the list of the package providers ... Read More

How to uninstall software using WMI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 08-Aug-2020 07:42:21

2K+ Views

There are mainly 3 methods by which you can uninstall software using PowerShell.WMI Method.Using Package providerUninstallation String.We will discuss here the WMI method to uninstall software.WMI methodWith WMI class Win32_Product you can retrieve the list of software uninstalled in your local or the remote systems. If you need specific software, ... Read More

Explain PowerShell Profile.

Chirag Nagrekar

Chirag Nagrekar

Updated on 08-Aug-2020 07:39:52

405 Views

When you open PowerShell, it loads the profile just like the Windows operating system. When you log in to windows OS you are logged into your profile and every user has their individual profile. It is called the current profile for the current host.To check your profile, type $Profile command ... Read More

Advertisements