Is it possible to override the Getter/Setter functions in a powershell 5 class?
<p>I recently started creating classes with powershell 5. While I was following this awesome guide <a href="https://xainey.github.io/2016/powershell-classes-and-concepts/#methods" rel="noreferrer">https://xainey.github.io/2016/powershell-classes-and-concepts/#methods</a> </p>

<p>I was wondering if it is possible to override the <code>get_x</code> and <code>set_x</code> methods.</p>

<p>Example:</p>

<pre><code>Class Foobar2 {
    [string]$Prop1    
}

$foo = [Foobar2]::new()
$foo | gm



Name        MemberType Definition                    
----        ---------- ----------                    
Equals      Method     bool Equals(System.Object obj)
GetHashCode Method     int GetHashCode()             
GetType     Method     type GetType()                
ToString    Method     string ToString()             
Prop1       Property   string Prop1 {get;set;}  
</code></pre>

<p>I would like to do it because I think it would be easier for other to access the properties than using my custom <code>Get</code> and <code>Set</code> methods:</p>

<pre><code>Class Foobar {
    hidden [string]$Prop1

    [string] GetProp1() {
        return $this.Prop1
    }

    [void] SetProp1([String]$Prop1) {
        $this.Prop1 = $Prop1
    }
}
</code></pre>