Skip to content

Commit c32b18d

Browse files
📖 [Docs]: README pages now use the standard module landing-page format (#43)
The README now works as a concise landing page for the module. It leads with what the module does, how to install it, a short usage showcase built from real commands, and where to find the full generated documentation. ## What changed - **Overview** — a one-paragraph description of what `Ast` does. - **Installation** — uses `Install-PSResource`, the current PowerShell Gallery client. - **Usage** — a short showcase of the most common commands (`Get-AstFunction`, `Get-AstFunctionName`, `Get-AstCommand`) run against a script. This is a getting-started showcase, not a full command reference: exhaustive per-command details stay in PowerShell help and the generated documentation so the landing page does not duplicate them. - **Documentation** — links to [psmodule.io/Ast](https://psmodule.io/Ast/) and shows `Get-Command` / `Get-Help` discovery using a real command name. - **Related tools** — keeps the pointer to the external `ShowPSAst` AST viewer. - Removed the `## Contributing` section. ## Technical details - Updates `README.md` only. - Aligns this repository with the standard module landing-page format used across PSModule.
1 parent 52672a9 commit c32b18d

1 file changed

Lines changed: 27 additions & 29 deletions

File tree

‎README.md‎

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# Ast
22

3-
A PowerShell module for using the Abstract Syntax Tree (AST) on any PowerShell code.
4-
5-
## Prerequisites
6-
7-
This uses the following external resources:
8-
- The [PSModule framework](https://github.com/PSModule) for building, testing and publishing the module.
3+
Ast is a PowerShell module for using the PowerShell abstract syntax tree (AST) to analyze PowerShell code. It provides
4+
commands to extract functions, commands, aliases, comments, and script structure from a file, a string of script content,
5+
or an existing AST object.
96

107
## Installation
118

12-
To install the module from the PowerShell Gallery, you can use the following command:
9+
Install the module from the PowerShell Gallery:
1310

1411
```powershell
1512
Install-PSResource -Name Ast
@@ -18,39 +15,40 @@ Import-Module -Name Ast
1815

1916
## Usage
2017

21-
Here is a list of example that are typical use cases for the module.
22-
23-
### Example 1: Get the function name from a script
18+
The commands accept a file path (`-Path`) or inline script content (`-Script`), and default to matching everything so
19+
you can narrow the results with `-Name`.
2420

25-
This example shows how to get the function name from a script.
21+
### Example: List the functions defined in a script
2622

2723
```powershell
28-
Get-AstFunctionName -Path 'Test-Me.ps1'
29-
Test-Me
24+
Get-AstFunction -Path ./MyScript.ps1
25+
Get-AstFunctionName -Path ./MyScript.ps1
3026
```
3127

32-
### Find more examples
28+
### Example: Find the commands invoked by a script
3329

34-
To find more examples of how to use the module, please refer to the [examples](examples) folder.
35-
36-
Alternatively, you can use the Get-Command -Module 'This module' to find more commands that are available in the module.
37-
To find examples of each of the commands you can use Get-Help -Examples 'CommandName'.
30+
```powershell
31+
Get-AstCommand -Path ./MyScript.ps1
32+
Get-AstCommand -Script "Get-Process; Write-Host 'Hello'"
33+
```
3834

39-
## Contributing
35+
### Example: Inspect a single function by name
4036

41-
Coder or not, you can contribute to the project! We welcome all contributions.
37+
```powershell
38+
Get-AstFunction -Path ./MyScript.ps1 -Name 'Test-Me'
39+
```
4240

43-
### For Users
41+
## Documentation
4442

45-
If you don't code, you still sit on valuable information that can make this project even better. If you experience that the
46-
product does unexpected things, throw errors or is missing functionality, you can help by submitting bugs and feature requests.
47-
Please see the issues tab on this project and submit a new issue that matches your needs.
43+
Documentation is published at [psmodule.io/Ast](https://psmodule.io/Ast/).
4844

49-
### For Developers
45+
Use PowerShell help and command discovery for module details:
5046

51-
If you do code, we'd love to have your contributions. Please read the [Contribution guidelines](CONTRIBUTING.md) for more information.
52-
You can either help by picking up an existing issue or submit a new one if you have an idea for a new feature or improvement.
47+
```powershell
48+
Get-Command -Module Ast
49+
Get-Help -Name Get-AstFunction -Examples
50+
```
5351

54-
## Tools
52+
## Related tools
5553

56-
- [lzybkr/ShowPSAst](https://github.com/lzybkr/ShowPSAst)
54+
- [lzybkr/ShowPSAst](https://github.com/lzybkr/ShowPSAst) — an interactive viewer for exploring the PowerShell AST.

0 commit comments

Comments
 (0)