Skip to content

🩹 [Patch]: Add function Get-ScriptCommand - #13

Merged
Marius Storhaug (MariusStorhaug) merged 11 commits into
mainfrom
scriptCommands
Jan 30, 2025
Merged

🩹 [Patch]: Add function Get-ScriptCommand#13
Marius Storhaug (MariusStorhaug) merged 11 commits into
mainfrom
scriptCommands

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jan 30, 2025

Copy link
Copy Markdown
Member

Description

This pull request introduces a new function Get-ScriptCommand to the PowerShell script and adds corresponding tests to ensure its functionality. The new function analyzes a specified PowerShell script to extract command invocations and optionally includes call operators.

New Functionality:

  • src/functions/public/Scripts/Get-ScriptCommands.ps1: Added a new function Get-ScriptCommand that retrieves commands used within a specified PowerShell script, including details such as command name, position, and file reference. It also provides an option to include call operators in the results.

Tests:

  • tests/Module.Tests.ps1: Added a new test context for the Get-ScriptCommands function to verify that it retrieves script commands correctly, ensuring the results are not null or empty, are of the correct type, and contain expected command names.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@github-actions

Copy link
Copy Markdown

Module AST - v0.2.2 published to the PowerShell Gallery.

@github-actions

Copy link
Copy Markdown

GitHub release for AST v0.2.2 has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant