Skip to content

Instantly share code, notes, and snippets.

View kilasuit's full-sized avatar

Ryan Yates kilasuit

View GitHub Profile
@kilasuit
kilasuit / Trace-Dependency.ps1
Created October 13, 2019 22:01 — forked from Jaykul/Trace-Dependency.ps1
Extract a list of commands used by a script or script command. Will warn about commands it can't identify and put them in global `$MissingCommands` variable.
#requires -Module Reflection
[CmdletBinding()]
param(
# The path to a script or name of a command
$Command,
# If you want to include private functions from a module, make sure it's imported, and pass the ModuleInfo here
[System.Management.Automation.PSModuleInfo]$ModuleScope = $(
Get-Module $Command -ListAvailable -ErrorAction SilentlyContinue | Get-Module -ErrorAction SilentlyContinue
),