This is a part of an on-going blog series written by Adam Gordon. Each week, Adam will walk you through a PowerShell command, showing you when and how to use each one. This week, Adam covers Find-Script.
When to use Find-Script
The Find-Script cmdlet finds a specified script in registered repositories.
How to use Find-Script
Find all available scripts:
Find-Script
Find-Script finds all available scripts.
Find a script and format the output as a list:
Find-Script -Name “StartCCMexec” -RequiredVersion 1.0 -Repository “PSGallery” | Format-List * -Force
This command finds “StartCCMexec” in the PSGallery repository, and then passes the resulting PSRepositoryItemInfo object to the Format-List cmdlet.
Find all versions of a script:
Find-Script -Name “New-TextMenu” -AllVersions
This command finds all versions of New-TextMenu.
Find scripts with workflows:
Find-Script -Includes “Workflow” -Repository “PSGallery”
Learn last week’s command: Find-RoleCapability.
Need PowerShell training? Check out ITProTV’s PowerShell online IT training courses.