I'm trying to define a class in Powershell v5 and I can't access variables from within class functions.
Ex.
PS C:\> class Foo{ $bar = 'foobar' mymethod(){ $bar + '123' } } PS C:\> [Foo]::new().mymethod() PS C:\> At line:4 char:11 + $bar + '123' Variable is not assigned in the method.