Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Looking for some help with a foreach loop script.

$
0
0

I’m looking to get a list of the names of all available modules, and then print them to a text or csv file. After that, I want to take that file, and run a foreach loop that will go through each name and print out the commands that are contained in that module and save each module to a separate text file. So far, I have “Get-Module -ListAvaliable | Select-Object Name | Sort-Object -Propterty Name | Out-File <path>Modules.csv” I also know that I need to run each line through a foreach loop that will input into “Get-Command -Module <ModuleName> | Select-Object Name | Sort-Object -Property Name | Out-File <path><ModuleName>Commands.txt” I’m just not entirely sure how to implement a foreach loop.

submitted by /u/tekkie1618
[link] [comments]

The post Looking for some help with a foreach loop script. appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images