Windows 10: Powershell not exiting properly from a script running on a remote device

Discus and support Powershell not exiting properly from a script running on a remote device in Windows 10 Software and Apps to solve the problem; We run powershell script through Vmware Vcenter API on the target VM in every 5 mins to collect some data. We noticed in one of the VMs on 19th that... Discussion in 'Windows 10 Software and Apps' started by Rohan Dassani, Sep 29, 2023.

  1. Powershell not exiting properly from a script running on a remote device


    We run powershell script through Vmware Vcenter API on the target VM in every 5 mins to collect some data. We noticed in one of the VMs on 19th that one powershell.exe was consuimg 45% CPU , when we checked the powershell logs we saw that the process is alive from around 4 days.We have a .wer file from that powershell , we need help to analyze what went wrong and what can be the possible causes of itVersion=1 EventType=APPCRASH EventTime=133393760467649737 ReportType=2 Consent=1 ReportIdentifier=redactedIntegratorReportIdentifier=redactedNsAppName=powershell.exe Response.type=4 Sig[0].Name=App

    :)
     
    Rohan Dassani, Sep 29, 2023
    #1
  2. Studynxx Win User

    Powershell / Batch scripts do NOT run!

    Please help me. I have written some powershell and batch scripts, yet when I run those files, they don't run. At most the powershell script just does step #1 but not all the other steps (lines of code / instructions). The batch script .bat file doesn't do anything. Both just pop up for like 2 seconds and then they disappear, Task Manager says nothing's being done.
     
    Studynxx, Sep 29, 2023
    #2
  3. is there a way to run cleanmgr.exe on remote machine using powershell

    Running CleanMgr.exe in a powershell script or by itself seems to work fine as long as you run it locally with an account that has local admin rights. But while trying to run it remotely via any remote management tool or remote scripting command (Invoke-Command) and it does not run. Would someone please let me know if there is way to get cleanmgr.exe to run remotely without any user interaction. like in,
     
    Shruthikeerthi, Sep 29, 2023
    #3
  4. EckiS Win User

    Powershell not exiting properly from a script running on a remote device

    PowerShell script run - Cmdlets

    As SQL-IP and Cosmos are still internal to Microsoft, I wonder why you are not simply contacting the person who provided you with the scripts.

    For point 1: see PowerShell: Bypass ExecutionPolicy to run downloaded scripts

    For point2: this is specific to the script: "Cosmos.Document" is probably in a module which is not found.
     
    EckiS, Sep 29, 2023
    #4
Thema:

Powershell not exiting properly from a script running on a remote device

Loading...
  1. Powershell not exiting properly from a script running on a remote device - Similar Threads - Powershell exiting properly

  2. Cannot get PowerShell script to run

    in Windows 10 Gaming
    Cannot get PowerShell script to run: Hi,No matter what I try I cannot get permission to run a .ps1 file. I always get this error:& : File C:\Program Files\putty\pagentpass.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at...
  3. Cannot get PowerShell script to run

    in Windows 10 Software and Apps
    Cannot get PowerShell script to run: Hi,No matter what I try I cannot get permission to run a .ps1 file. I always get this error:& : File C:\Program Files\putty\pagentpass.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at...
  4. Powershell not exiting properly from a script running on a remote device

    in Windows 10 Gaming
    Powershell not exiting properly from a script running on a remote device: We run powershell script through Vmware Vcenter API on the target VM in every 5 mins to collect some data. We noticed in one of the VMs on 19th that one powershell.exe was consuimg 45% CPU , when we checked the powershell logs we saw that the process is alive from around 4...
  5. Run desktop script in PowerShell

    in Windows 10 Network and Sharing
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  6. Run desktop script in PowerShell

    in Windows 10 Gaming
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  7. Run desktop script in PowerShell

    in Windows 10 Software and Apps
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  8. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  9. Run PowerShell Script As An Administrator

    in Windows 10 Support
    Run PowerShell Script As An Administrator: Hi. So I've been searching online on a way to do this yet I cannot find a way to do it. _______________________________________ I need this in specific: I want to double click a PowerShell script file (which will run as an administrator) from Windows Explorer that has...
  10. PowerShell Scripting - Run a Script from Shortcut

    in Windows 10 Tutorials
    PowerShell Scripting - Run a Script from Shortcut: How to: PowerShell Scripting - Run a Script from Shortcut [img] Information One of many PowerShell security features is that you can't run a script simply by double clicking it's icon on desktop or in a folder. Doing so will by default open script in Notepad for editing...