I\'m looking for a feature comparable to Python interactive shell\'s \"_\" variable. In PowerShell I want something like this:
> Get-Something # this returns
Not exactly. There's the $_ automatic value which contains the current object in the pipe-line.
The pipeline is the usual way to pass a result from one cmdlet to the next, and cmdlets are set to accept parameters from the pipeline or from the properties of objects in the pipeline making the use of a "last result" variable irrelevant.
Still some situations do require a specific reference to the "piped" object and for those there's the $_ automatic value.
Here's an example of its usage: Using the Where-Object Cmdlet and here's a list of powershell's automatic variables: Chapter 4. PowerShell Automatic Variables
Scripting in powershell requires a different style than programming in Python (same as Python requires a different style than C++.)
Powershell is built so pipes are used extensively, if you want to break up a pipeline into a more procedural step by step structure you'll need to save your results in named variables not automatic ones.