Use-ClassAccessors

0.1.3

The [Use-ClassAccessors][1] cmdlet updates script property of a class from the getter and setter methods.
Which are also known as [accessors or mutator methods][2].

The getter and setter methods should use the following syntax:

### getter syntax

   [<type>] get_<property name>() {
     return <variable>
   }

or:

   [Object] get_<property name>() {
     retur
The [Use-ClassAccessors][1] cmdlet updates script property of a class from the getter and setter methods.
Which are also known as [accessors or mutator methods][2].

The getter and setter methods should use the following syntax:

### getter syntax

   [<type>] get_<property name>() {
     return <variable>
   }

or:

   [Object] get_<property name>() {
     return [<Type>]<variable>
   }

> [!NOTE]
> Any (single) item array will be unrolled if the `[Object]` type is used for the getter method.

### setter syntax

   set_<property name>(<variable>) {
     <code>
   }

> [!NOTE]
> A **setter** accessor requires a **getter** accessor to implement the related property.

> [!NOTE]
> In most cases, you might want to hide the getter and setter methods using the [`hidden` keyword][3]
> on the getter and setter methods.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Use-ClassAccessors

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Package Details

Author(s)

  • Ronald Bode (iRon)

Tags

Accessors Getter Setter Class get_ set_ TypeData

Dependencies

This script has no dependencies.

FileList

Version History

Version Downloads Last updated
0.1.3 (current version) 7 8/22/2024
0.1.2 3 8/20/2024
0.1.1 10 2/27/2024
0.1.0 5 2/26/2024
0.0.4 6 2/21/2024
0.0.3 8 1/17/2024
0.0.2 6 1/17/2024
0.0.1 6 1/16/2024
Show more