Chirag Nagrekar has Published 465 Articles

How to use Azure Rest API in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:53:45

To use the Azure Rest API using PowerShell, we first need to connect to the Azure cloud account using the Connect-AzAccount. Once you are connected to the Azure Account, you can use the below authorization header (same has been provided on the MS website) which contains a bearer token to ... Read More

How to resolve - Relative path is not supported in PowerShell DSC?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:35:58

“Relative path is not supported” error generally occurs with the PowerShell DSC when we download a file from online or Website and we use “File” DscResource for that.In the below example, we are downloading the PowerShell 7.1.4 version from GitHub using DSC to the local computer and we get the ... Read More

How to install DSC resources using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:21:55

To install the DSC resource using PowerShell, we can use the same command to install modules in PowerShell (Install-Module).The Find-DscResource command would get all the available DSC resources. To search the specific DSC resource, you can provide the -Name parameter in the Find-DscReource command. For example, we need to search for ... Read More

How to generate multiple reports in HTML using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:18:57

To generate or append multiple outputs in the HTML file using PowerShell, we need to use the - Fragment parameter in the ConvertTo-HTML command.For example, let say we need to generate the computer utilization report which includes the top 5 consuming processes, stopped services, and the disk utilization report. A ... Read More

How to generate an HTML report using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:16:26

To generate an HTML report using PowerShell, we can use the ConvertTo-HTML command. For example, let say we need to get the services to report in HTML format then we can use ConvertTo-HTML as a pipeline.Get-Service | ConvertTo-Html | Out-File C:\Temp\Services.html ii C:\Temp\services.htmlThe first command will retrieve the output in ... Read More

How to create dynamic columns (headers) in CSV using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:08:14

To create dynamic columns or headers using CSV, we can use multiple methods but the one method that I find most suitable is the PSObject method.Let assume that your CSV column headers depend on the input provided by the user. Input can be a text file, user prompt for headers, ... Read More

How to delete the azure blob (File) using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:06:45

To delete the Azure blob using Azure CLI, we can use “az storage blob” command with the “delete” parameter. Before running this command, we first need to make sure that the azure account is connected (az login) and the proper subscription is set (az account set).To work with the azure ... Read More

How to get the Azure storage container blobs (Files) using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 08:01:43

To get blobs inside the Azure storage container using PowerShell, we will use the Get-AzStorageBlob command. . Before running this command, we need to make sure that the Azure cloud account is connected (Connect-AzAccount) and the proper subscription is set in which the storage account resides (Set-AzContext).To work with the ... Read More

How to export output to excel in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 07:46:30

As of now, there is no built-in command like CSV (Export-CSV) to export output to the excel file but we can use the Out-File command to export data to excel or any other file format.Let’s use Out-File to export the output of the Get-Processes command to an excel file.Get-Process | ... Read More

How to resolve - The underlying connection was closed - Could notestablish trust relationship for the SSL/TLS secure channel in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Sep-2021 07:43:41

When you run Invoke-WebRequest or Invoke-RestMethod command, sometimes you get the error “The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.” because there could be a certificate issue or the required windows version doesn’t support the TLS or SSL version. You can use the ... Read More

Previous 1 ... 3 4 5 6 7 ... 47 Next
Advertisements