PowerTip: Find Name and Location of PowerShell Profiles

Doctor Scripto

Dr Scripto

Summary: Learn how to find the name and location of various Windows PowerShell profiles.

Hey, Scripting Guy! Question How can I find the name and location of various Windows PowerShell profiles?

Hey, Scripting Guy! Answer Use the $profile automatic variable to see what profiles are available for your particular Windows PowerShell
           host (for example, the console host or the ISE). To find only the name and the location of the profiles,
           you need to return only the properties from the object and then look for names that  begin with A or C,
           for example:

(($PROFILE).psobject.Properties).where({$_.name -match 'a|c'}) | select name, value

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment