• /r/powershell
  • Get-UserSessionEx – Get all user session info in one place…for real though.

    Get-UserSessionEx is capable of outputting User Session information for an array of Computers by combining output from query.exe and Get-CimInstance. The goal is to gather all of the most useful Session information in one place. Get-UserSessionEX.ps1 Link: https://github.com/pldmgg/misc-powershell/blob/master/Get-UserSessionEx.ps1 The Get-UserSessionEx function is composed (primarily) of two functions: Get-UserSessionViaQuery and Get-UserSessionViaCim. The Get-UserSessionViaQuery function is a […]

  • /r/powershell
  • Self-Installing Module: Bad idea?

    I’m trying to make the my new module (first on our team) easy for everyone to install. In short, I renamed my .psm1 file back to psm1 and threw in the following code at the bottom: if (-not $MyInvocation.MyCommand -like ‘*.ps1’) { Export-ModuleMember -Function Import-BanCSV, ConvertTo-BanVal -Alias bcsv, cban } else { $moduleName = (Get-Item […]