Windows PowerShell for .NET Developers - Second Edition by Chendrayan Venkatesan & Sherif Talaat

Windows PowerShell for .NET Developers - Second Edition by Chendrayan Venkatesan & Sherif Talaat

Author:Chendrayan Venkatesan & Sherif Talaat [Venkatesan, Chendrayan]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2015-10-27T04:00:00+00:00


We can also hide the properties in a PowerShell class; as an example, let's create two properties and hide one. In theory, it hides the property but we can still use it. Execute the following code:

Class Hide { [String]$Name Hidden $ID } $var = [Hide]::new() $var

However, we can perform operations such as Get and Set, as shown in the following code:

Class Hide { [String]$Name Hidden $ID } $var = [Hide]::new() $var.Id = '23' $var.Id

This will return the output as 23.

To know more about the class, use help about_Classes -Detailed.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.