PowerShell command to list all the environment variables of virtual machine

Varma 1,495 Reputation points
2024-02-09T15:44:12.2533333+00:00

Is there any PowerShell command to list all the environment variables available in Virtual machine and export to CSV file

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
{count} votes

Accepted answer
  1. shiva patpi 13,366 Reputation points Microsoft Employee Moderator
    2024-02-12T01:16:30.49+00:00

    Hello Varma, You can use the below command:Get-ChildItem -Path Env:To also export to csv use: Get-ChildItem -Path Env: | Export-Csv test.csvUser's image

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.