diff --git a/ICSharpCode.Decompiler.PowerShell/Demo.ps1 b/ICSharpCode.Decompiler.PowerShell/Demo.ps1 index a49419c23..d734f91d5 100644 --- a/ICSharpCode.Decompiler.PowerShell/Demo.ps1 +++ b/ICSharpCode.Decompiler.PowerShell/Demo.ps1 @@ -1,5 +1,13 @@ -Import-Module .\bin\Debug\netstandard2.0\ICSharpCode.Decompiler.Powershell.dll -$decompiler = Get-Decompiler .\bin\Debug\netstandard2.0\ICSharpCode.Decompiler.Powershell.dll +$basePath = $PSScriptRoot +if ([string]::IsNullOrEmpty($basePath)) +{ + $basePath = Split-Path -parent $psISE.CurrentFile.Fullpath +} + +$modulePath = $basePath + '\bin\Debug\netstandard2.0\ICSharpCode.Decompiler.Powershell.dll' + +Import-Module $modulePath +$decompiler = Get-Decompiler $modulePath $classes = Get-DecompiledTypes $decompiler -Types class $classes.Count