0

I found this script here on Stack Overflow by Pmental I am new too PowerShell, but when I run the script, (even as admin) the script seems to run but I get no output either to the screen or to any file. I used: Get-ProcessPlus and Get-ProcessPlus using Firefox with no errors and no results. What am I doing wrong? Any help would be great.

Toni
  • 1,555
  • 4
  • 15
  • 23
b4iknew
  • 23
  • 6
  • 1
    Have you tried running it against a specific process id? `Get-ProcessPlus -Id $PID` for example – Mathias R. Jessen Jul 05 '21 at 14:20
  • Hi Mathis, I have yes and I get the same result, which is nothing displayed and no errors. – b4iknew Jul 05 '21 at 14:24
  • Can you run it against a different process, or can you try using a new instance of Powershell to run it from? – Abraham Zinala Jul 05 '21 at 14:25
  • Hi Abraham, I can open Powershell as Admin. Then I have tried to run it on several different processes eg: firefox, nvidia, battlenet, steamclient, all with the same result. I have also tried running it in Powershell ISE. It runs with no errors and no output to any display – b4iknew Jul 05 '21 at 14:29
  • The script may require a newer PS version than you have installed on your machine. Try updating to the latest release version: https://github.com/PowerShell/PowerShell/releases – zett42 Jul 05 '21 at 14:34
  • Hi zett42, I was using Powershell v. 5.1.19041. As you had suggested I went to https://github.com/PowerShell/PowerShell/releases and download and installed PowerShell 7.2.0-preview.7. Tried all the same commands while running it as Admin and got the same results. No errors and no output. Thanks for your input – b4iknew Jul 05 '21 at 15:04
  • Here https://puu.sh/HU4ii.PNG is link of a screenshot showing many of the commands used. Thanks again for any and all help. – b4iknew Jul 05 '21 at 15:29
  • The script works for me (PS 7.1). How are you calling it? Try to save it to a file with ".psm1" extension, e. g. "ProcessPlus.psm1" next to your own ".ps1" script. Import the file once at the beginning of your script: `Import-Module $PSScriptRoot\ProcessPlus.psm1`. Then call the imported function like `Get-ProcessPlus svchost`. – zett42 Jul 05 '21 at 15:53
  • Hi zett42, so I upgraded PS command iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI" to v 7.1. I copied script to new file and saved it with the .psm1 extension. From a PS 7.1 window I issued the command Import-Module $PSScriptRoot\ProcessPlus.psm1 and the error i get is Import-Module: The specified module '\ProcessPlus.psm1' was not loaded because no valid module file was found in any module directory. The Get-ProcessPlus.psm1 file is in the same directory as the original Get-ProcessPlus.ps1 file. I'm really at a loss now. – b4iknew Jul 05 '21 at 16:33
  • Note: All my other .ps1 scripts seem to work fine in this PS 7.1 window – b4iknew Jul 05 '21 at 16:37
  • Retried using correct file name: Import-Module $PSScriptRoot\Get-ProcessPlus.psm1 Import-Module: The specified module '\Get-ProcessPlus.psm1' was not loaded because no valid module file was found in any module directory. – b4iknew Jul 05 '21 at 16:42
  • Well zett42, I finally got it to work. Normally I would issue commands from that directory as such .\Get-ProcessPlus.ps1 so I removed the .\ and the .ps1 from the command and issued just Get-ProcessPlus svchost and it worked perfectly. Thank you very much for your time and knowledge. It's a bit awkward trying to learn a language at age 61. Have a great day! – b4iknew Jul 05 '21 at 17:00

0 Answers0