Skip to content

Instantly share code, notes, and snippets.

@toonech
toonech / godot_accessor.ps1
Created July 31, 2020 20:23
PowerShell function to generate field and accessors for gdscript (Godot Game Engine), inspired by Bitwes bash script for Mac
function New-GdAccessor{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true, Position=1, ParameterSetName="Set1")]
[Parameter(Mandatory=$true, Position=1, ParameterSetName="Set2")]
[ValidatePattern('^_[a-zA-Z0-9]+$')]
[string] $Backing,
[Parameter(Mandatory=$true, Position=2, ParameterSetName="Set2")]
$InitialValue,
[Parameter()]