Finding Built-In Variables
[psobject].Assembly.GetType('System.Management.Automation.SpecialVariables').GetFields('NonPublic,Static') | Where-Object FieldType -eq ([string]) | ForEach-Object GetValue $null
Once you know the built-in variables, it is easy to sort them out and create a function that displays just your own variables. As it turns out, there are still a couple of built-in variables left that need to be hand-coded, but then Get-MyVariable is a useful function to list all user variables:
function Get-MyVariable { $builtin = [psobject].Assembly.GetType('System.Management.Automation.SpecialVariables').GetFields('NonPublic,Static') | Where-Object FieldType -eq ([string]) | ForEach-Object GetValue $null $builtin += 'MaximumAliasCount','MaximumDriveCount','MaximumErrorCount', 'MaximumFunctionCount', 'MaximumFormatCount', 'MaximumVariableCount', 'FormatEnumerationLimit', 'PSSessionOption', 'psUnsupportedConsoleApplications' Get-Variable | Where-Object { $builtin -NotContains $_.Name } | Select-Object -Property Name, Value, Description }