diff --git a/Types/Posh.Host.UI.Box/get_ColumnCount.ps1 b/Types/Posh.Host.UI.Box/get_ColumnCount.ps1 new file mode 100644 index 0000000..439257a --- /dev/null +++ b/Types/Posh.Host.UI.Box/get_ColumnCount.ps1 @@ -0,0 +1,13 @@ +<# +.SYNOPSIS + Gets the number of columns in a box. +.DESCRIPTION + Gets the number of columns in a Posh.Host.UI.Box object. +.NOTES + This script checks if the '.ColumnCount' property is null and adds it as a NoteProperty with a default value of 0 if it is. + It then returns the value of the '.ColumnCount' property. +#> +if ($null -eq $this.'.ColumnCount') { + $this | Add-Member NoteProperty '.ColumnCount' 0 -Force +} +$this.'.ColumnCount' diff --git a/Types/Posh.Host.UI.Box/set_ColumnCount.ps1 b/Types/Posh.Host.UI.Box/set_ColumnCount.ps1 new file mode 100644 index 0000000..fde626b --- /dev/null +++ b/Types/Posh.Host.UI.Box/set_ColumnCount.ps1 @@ -0,0 +1,11 @@ +<# +.SYNOPSIS + Sets the number of columns in a box. +.DESCRIPTION + Sets the number of columns in a Posh.Host.UI.Box object. +#> +param( +[int]$ColumnCount +) +$this | Add-Member NoteProperty '.ColumnCount' $ColumnCount -Force +