I am trying to get running processes in a function within a class but it does nothing. Looks like the compiler ignores it, however, outside of the class it works perfectly.
<# Works here #>
#Get-Process
class Test
{
[void]TestFunction()
{
<# DOES NOT WORK HERE #>
Get-Process
}
}
[Test]$object = [Test]::new()
$object.TestFunction()
<# Works here #>
#Get-Process
P.S. I am using PowerShell on macOS with VS Code