Skip to content

Commit 28ef442

Browse files
📖 [Docs]: Fix docs (#30)
## Description Redeploy docs after Document-PSModule fix was implemented. Will again place docs in the right folder structure on the site.
1 parent 55777b9 commit 28ef442

3 files changed

Lines changed: 41 additions & 41 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AST
1+
# Ast
22

33
A PowerShell module for using the Abstract Syntax Tree (AST) on any PowerShell code.
44

@@ -12,8 +12,8 @@ This uses the following external resources:
1212
To install the module from the PowerShell Gallery, you can use the following command:
1313

1414
```powershell
15-
Install-PSResource -Name AST
16-
Import-Module -Name AST
15+
Install-PSResource -Name Ast
16+
Import-Module -Name Ast
1717
```
1818

1919
## Usage
@@ -25,7 +25,7 @@ Here is a list of example that are typical use cases for the module.
2525
This example shows how to get the function name from a script.
2626

2727
```powershell
28-
Get-ASTFunctionName -Path 'Test-Me.ps1'
28+
Get-AstFunctionName -Path 'Test-Me.ps1'
2929
Test-Me
3030
```
3131

tests/AST.Tests.ps1

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
#Requires -Modules @{ ModuleName = 'Pester'; RequiredVersion = '5.7.1' }
22

33
Describe 'Core' {
4-
Context "Function: 'Get-ASTScript'" {
5-
It 'Get-ASTScript gets the script AST' {
4+
Context "Function: 'Get-AstScript'" {
5+
It 'Get-AstScript gets the script Ast' {
66
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
7-
$script = Get-ASTScript -Path $path
7+
$script = Get-AstScript -Path $path
88
$script | Should -Not -BeNullOrEmpty
99
$script.Ast | Should -BeOfType [System.Management.Automation.Language.ScriptBlockAst]
1010
}
1111
}
12-
Context "Function: 'Get-ASTFunction'" {
13-
It 'Get-ASTFunction gets the function AST' {
12+
Context "Function: 'Get-AstFunction'" {
13+
It 'Get-AstFunction gets the function Ast' {
1414
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
15-
$function = Get-ASTFunction -Path $path
15+
$function = Get-AstFunction -Path $path
1616
$function | Should -Not -BeNullOrEmpty
1717
$function.Ast | Should -BeOfType [System.Management.Automation.Language.FunctionDefinitionAst]
1818
}
1919
}
20-
Context "Function: 'Get-ASTCommand'" {
21-
It 'Get-ASTCommand gets the command AST' {
20+
Context "Function: 'Get-AstCommand'" {
21+
It 'Get-AstCommand gets the command Ast' {
2222
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
23-
$command = Get-ASTCommand -Path $path
23+
$command = Get-AstCommand -Path $path
2424
$command | Should -Not -BeNullOrEmpty
2525
$command.Ast | Should -BeOfType [System.Management.Automation.Language.CommandAst]
2626
}
2727
}
2828
}
2929

3030
Describe 'Functions' {
31-
Context "Function: 'Get-ASTFunctionType'" {
32-
It 'Get-ASTFunctionType gets the function type' {
31+
Context "Function: 'Get-AstFunctionType'" {
32+
It 'Get-AstFunctionType gets the function type' {
3333
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
34-
$functionType = Get-ASTFunctionType -Path $path
34+
$functionType = Get-AstFunctionType -Path $path
3535
$functionType.Type | Should -Be 'Function'
3636
}
3737
}
38-
Context "Function: 'Get-ASTFunctionName'" {
39-
It 'Get-ASTFunctionName gets the function name' {
38+
Context "Function: 'Get-AstFunctionName'" {
39+
It 'Get-AstFunctionName gets the function name' {
4040
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
41-
$functionName = Get-ASTFunctionName -Path $path
41+
$functionName = Get-AstFunctionName -Path $path
4242
$functionName | Should -Be 'Test-Function'
4343
}
4444
}
45-
Context "Function: 'Get-ASTFunctionAlias'" {
46-
It 'Get-ASTFunctionAlias gets the function alias' {
45+
Context "Function: 'Get-AstFunctionAlias'" {
46+
It 'Get-AstFunctionAlias gets the function alias' {
4747
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
48-
$functionAlias = Get-ASTFunctionAlias -Path $path
48+
$functionAlias = Get-AstFunctionAlias -Path $path
4949
$functionAlias.Alias | Should -Contain 'Test'
5050
$functionAlias.Alias | Should -Contain 'TestFunc'
5151
$functionAlias.Alias | Should -Contain 'Test-Func'
@@ -54,34 +54,34 @@ Describe 'Functions' {
5454
}
5555

5656
Describe 'Lines' {
57-
Context 'Function: Get-ASTLineComment' {
58-
It 'Get-ASTLineComment gets the line comment' {
57+
Context 'Function: Get-AstLineComment' {
58+
It 'Get-AstLineComment gets the line comment' {
5959
$line = '# This is a comment'
60-
$line = Get-ASTLineComment -Line $line
60+
$line = Get-AstLineComment -Line $line
6161
$line | Should -Be '# This is a comment'
6262
}
63-
It 'Get-ASTLineComment gets the line comment without leading whitespace' {
63+
It 'Get-AstLineComment gets the line comment without leading whitespace' {
6464
$line = ' # This is a comment'
65-
$line = Get-ASTLineComment -Line $line
65+
$line = Get-AstLineComment -Line $line
6666
$line | Should -Be '# This is a comment'
6767
}
68-
It 'Get-ASTLineComment gets the line comment but not the command' {
68+
It 'Get-AstLineComment gets the line comment but not the command' {
6969
$line = ' Get-Command # This is a comment '
70-
$line = Get-ASTLineComment -Line $line
70+
$line = Get-AstLineComment -Line $line
7171
$line | Should -Be '# This is a comment '
7272
}
73-
It 'Get-ASTLineComment returns nothing when no comment is present' {
73+
It 'Get-AstLineComment returns nothing when no comment is present' {
7474
$line = 'Get-Command'
75-
$line | Get-ASTLineComment | Should -BeNullOrEmpty
75+
$line | Get-AstLineComment | Should -BeNullOrEmpty
7676
}
7777
}
7878
}
7979

8080
Describe 'Scripts' {
81-
Context "Function: 'Get-ASTScriptCommands'" {
82-
It 'Get-ASTScriptCommands gets the script commands' {
81+
Context "Function: 'Get-AstScriptCommands'" {
82+
It 'Get-AstScriptCommands gets the script commands' {
8383
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
84-
$commands = Get-ASTScriptCommand -Path $path
84+
$commands = Get-AstScriptCommand -Path $path
8585
$commands | Should -Not -BeNullOrEmpty
8686
$commands | Should -BeOfType [pscustomobject]
8787
$commands.Name | Should -Not -Contain 'ForEach-Object'
@@ -91,9 +91,9 @@ Describe 'Scripts' {
9191
$commands.Name | Should -Not -Contain '.'
9292
$commands.Name | Should -Not -Contain '&'
9393
}
94-
It 'Get-ASTScriptCommands gets the script commands (recursive)' {
94+
It 'Get-AstScriptCommands gets the script commands (recursive)' {
9595
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
96-
$commands = Get-ASTScriptCommand -Path $path -Recurse
96+
$commands = Get-AstScriptCommand -Path $path -Recurse
9797
$commands | Should -Not -BeNullOrEmpty
9898
$commands | Should -BeOfType [pscustomobject]
9999
$commands.Name | Should -Contain 'ForEach-Object'
@@ -103,9 +103,9 @@ Describe 'Scripts' {
103103
$commands.Name | Should -Not -Contain '.'
104104
$commands.Name | Should -Not -Contain '&'
105105
}
106-
It 'Get-ASTScriptCommands gets the script commands with call operators' {
106+
It 'Get-AstScriptCommands gets the script commands with call operators' {
107107
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
108-
$commands = Get-ASTScriptCommand -Path $path -IncludeCallOperators
108+
$commands = Get-AstScriptCommand -Path $path -IncludeCallOperators
109109
$commands | Should -Not -BeNullOrEmpty
110110
$commands | Should -BeOfType [pscustomobject]
111111
$commands.Name | Should -Not -Contain 'ForEach-Object'
@@ -115,9 +115,9 @@ Describe 'Scripts' {
115115
$commands.Name | Should -Not -Contain '.'
116116
$commands.Name | Should -Not -Contain '&'
117117
}
118-
It 'Get-ASTScriptCommands gets the script commands with call operators (recursive)' {
118+
It 'Get-AstScriptCommands gets the script commands with call operators (recursive)' {
119119
$path = Join-Path $PSScriptRoot 'src\Test-Function.ps1'
120-
$commands = Get-ASTScriptCommand -Path $path -Recurse -IncludeCallOperators
120+
$commands = Get-AstScriptCommand -Path $path -Recurse -IncludeCallOperators
121121
$commands | Should -Not -BeNullOrEmpty
122122
$commands | Should -BeOfType [pscustomobject]
123123
$commands.Name | Should -Contain 'ForEach-Object'

tests/src/Test-Function.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[Alias('Test-Func')]
1313
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
1414
'PSAvoidUsingCmdletAliases',
15-
Justification = 'Want to see that ASTCommand actually can get aliases.'
15+
Justification = 'Want to see that AstCommand actually can get aliases.'
1616
)]
1717
[CmdletBinding()]
1818
param (

0 commit comments

Comments
 (0)