'Powershell script to Get-Process then prompt for input of ID for Stop-Process

I have two Powershell commands that I'd like to create a script with. I've searched for a while and can't seem to find anything similar to what I need. I need to ask for input (Id) for the second command, after being able to view the processes from the first command. The process I need to kill will not always be the same, hence the need for input on which one to kill.

  1. Get-Process -Computername computername
  2. Stop-Process -ComputerName computername -Id #### -Confirm -PassThru

I greatly appreciate any info I receive.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source