What Scope Am I In?
In PowerShell the question of scope is too complicated and convoluted. I’m going to try to help you understand it, but I’m not guaranteeing that I will be able to make it seem any simpler than it actually is. Hopefully, I won’t make it more complicated than it inherently is In PowerShell you always have [...]
How to Import Binary Modules from Network Shares
Note: This is from a wiki page I just wrote on Importing Binary Modules from Network Shares which discusses not just the solution below that works for .Net 2.0 but also how to solve the problem on .Net 4.0 (e.g.: in PoshConsole). I will most likely not keep this page up to date, so you [...]
PowerShell PowerUser Tips: List the Cmdlets in an Assembly
Tiny script… let me know if you know a better way. function Get-Cmdlets { param([System.Reflection.Assembly]$assembly) $assembly.GetTypes() | Where-Object { $_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false) } | ForEach-Object { $type = $_ $_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false) } | Select VerbName, NounName, @{n="Type";e={$type}} | } ## Example usage. ## You can use the [System.Reflection.Assembly]::Load… methods to get [...]
PowerShell Power User Tips: Bash-style “alias” command.
I keep hearing from new users who are used to bash-style aliases, how frustrating it is not to be able to create aliases with parameters, the way you can in bash … I’m going to show you how to make the “alias” command work roughly the way it does in bash, but first, let me [...]