Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

produce a text file containing only cmdlets parameters & their required or not required property

$
0
0

hi friends

i noticed a cool trick in powershell. i noticed that when working with PS help system, i can export parameters separatly to a text file.( & not other contents when we run Get-Help mycmdlet)

for example

(Get-Help New-ADUser).parameters | out-file c:\onlyParameters.txt

now i need to run a code on c:\onlyParameters.txt so that only the parameter name & its required property remain on that file (or be saved as new text file). for example i need the final neat file be such simple structure:

(this handy when working on cmdlets which have lots of parameters & we want easily to find out which parameters are true & which are false , without facing extra information & lines)

-AccountExpirationDate  false

-AccountNotDelegated  false

-name true

 

i tried to achieve that via Get-content & also select-string, but i was unable to produce such neat output file.

any code to reach that?

thanks in advanced


Viewing all articles
Browse latest Browse all 6937

Trending Articles