Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdhitsolutions/PSScriptingInventory
A demonstration PowerShell module to analyze files for PowerShell commands.
https://github.com/jdhitsolutions/PSScriptingInventory
ast powershell
Last synced: 3 months ago
JSON representation
A demonstration PowerShell module to analyze files for PowerShell commands.
- Host: GitHub
- URL: https://github.com/jdhitsolutions/PSScriptingInventory
- Owner: jdhitsolutions
- License: mit
- Created: 2020-06-17T17:49:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-19T13:42:52.000Z (over 4 years ago)
- Last Synced: 2024-05-28T02:19:43.933Z (5 months ago)
- Topics: ast, powershell
- Language: PowerShell
- Size: 23.4 KB
- Stars: 13
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: License.txt
Awesome Lists containing this project
- jimsghstars - jdhitsolutions/PSScriptingInventory - A demonstration PowerShell module to analyze files for PowerShell commands. (PowerShell)
README
# PSScriptingInventory
A set of PowerShell tools for inventorying PowerShell commands. The code in this module should be considered educational and as proof-of-concept. This code was designed to meet a PowerShell scripting challenge described at [https://ironscripter.us/building-a-powershell-command-inventory/](https://ironscripter.us/building-a-powershell-command-inventory/). Early versions of these commands are described at [https://jdhitsolutions.com/blog/powershell/7549/building-a-powershell-inventory/](https://jdhitsolutions.com/blog/powershell/7549/building-a-powershell-inventory/).
## Concepts and Techniques
The functions are all contained in the .psm1 file. In the code you'll see that I'm taking advantage of these PowerShell concepts and scripting techniques.
+ PowerShell Classes and custom objects
+ The PowerShell AST
+ Formatting .ps1xml files
+ Parallelism with thread jobs in Windows PowerShell and `ForEach-Object -parallel` in PowerShell 7
+ Regular Expressions
+ Write-Verbose
+ Write-Information## Installing
There is no intention of publishing this to the PowerShell Gallery at this time since it doesn't fill a real production need. You are more than welcome to clone or fork this repository. You can also download the latest code in a zip file and extract locally. This project includes a script file, `deploy.ps`, which you can use to copy the module to your Windows PowerShell module location. You will need to deploy the module if you want to take advantage of the background or parallel features.
If you are running Windows PowerShell and want to use the job feature, you'll need to install the ThreadJob module from the PowerShell Gallery.
## Additional Reading
If you want to expand your PowerShell scripting knowledge, or learn more about some of the techniques used in the project, I recommend getting a copy of [The PowerShell Scripting and Toolmaking](https://leanpub.com/powershell-scripting-toolmaking) book.