Chirag Nagrekar has Published 468 Answers

How to get the disk performance using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:08:15

To get the disk performance using PowerShell, we need to use the Performance counter of the disk. There are performance counters available for the Physical disk or the logical disk. To check what the disks related counter sets are available we can use the below command, ExamplePS C:\> Get-Counter -ListSet ... Read More

How to get the Process performance counter using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:07:51

To get all the process-related counters, you need to use the below command.ExampleGet-Counter -ListSet "*Processor*" | Select CounterSetNameOutputCounterSetName -------------- Processor Information Per Processor Network Activity Cycles Per Processor Network Interface Card Activity Hyper-V Worker Virtual Processor Hyper-V Hypervisor Virtual Processor Hyper-V Hypervisor Root Virtual Processor Hyper-V Hypervisor Logical Processor Processor ... Read More

How to get the windows performance counter using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:07:01

To get the Windows Performance counter using the Powershell, we can use the Get-Counter cmdlet.There are various performance counters available to measure the performance of the windows operating system. Get-Counter cmdlet is used to retrieve the performance of the local or the remote systems with the specific counter name.When you ... Read More

How to delete all the tags of the azure resource using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 08:06:13

To delete all the tags of the Azure VM using PowerShell, we need to use the Remove-AZTag command.To delete the azure resource tags, we need its resource ID but before that, it is always better to take azure resource tags backup. You can search the question on the TutorialPoints site ... Read More

How to retrieve CSV file headers using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 08:04:58

To retrieve the CSV file headers using PowerShell, we need to use the hidden property PSObject once we use to import the CSV file. We have a CSV file stored at the C:\temp\VMTags.csv and we need to retrieve its headers. The CSV file is as below.ABCDForPatching_DayApplicationOwnerAnsibleSundaySecretTagChiragImporting the CSV file, PS ... Read More

How to convert JSON to CSV file using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 08:00:52

To convert the JSON to the CSV format we need to first use the ConvertFrom-JSON command. For example, we have already JSON file present with us at the C:\temp\VMinfo.JSON location. We will first import this file and then convert it to CSV as shown below.Get-Content C:\Temp\VMInfo.json | ConvertFrom-Json | Export-Csv ... Read More

How to change the Azure tag value using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 07:59:15

To change the azure value using PowerShell we need to use the Update-AZTag command with the merge property.ExampleFor example, we have the Azure VM TestMachine2k16 and we have its tags as shown below.PS C:\> $vm = Get-AzVM -VMName TestMachine2k16 PS C:\> $vm | Select -ExpandProperty TagsOutputKey          Value ... Read More

How to get the applied azure resource tags using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 07:57:16

To get all the applied tags to the Azure resources we need to use the Get-AZTag command and need to provide ResourceID to it. For example, We need to retrieve the Azure VM tags and we will use its resource ID.PS C:\> $vm = Get-AzVM -Name Testmachine2k16 PS C:\> Get-AzTag ... Read More

How to apply a tag to the azure resource group using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 07:54:56

Like Azure VM, we can apply the azure tags to the resource group or any other resources. The tagging works on the resource ID and in azure, all the resources come with the resource ID property.To apply the tag to the azure resource group, we first need to use get ... Read More

What is the difference between the New-AZTag and Update-AZTag command in Azure PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 06-Apr-2021 07:53:31

New-AZTagWhen we use the New-AZTag command, it removes all the tags from the particular resource and adds a new tag. This command is generally helpful when we are creating a new resource and we want to apply the tag for it.Update-AZTagWhen we use the Update-AZTag command, it updates, deletes, and ... Read More

Advertisements