Summary
Delving into .NET significantly increases the flexibility of PowerShell over using built-in commands and operators. .NET is made up of hundreds of classes and enumerations, many of which can be easily used in PowerShell.
.NET types are arranged in namespaces, grouping types with similar purposes together. For example, the System.Data.SqlClient
namespace contains types for connecting to and querying Microsoft SQL Server instances.
The using
keyword, introduced with PowerShell 5.1, allows types to be used by name only, instead of the full name that includes the namespace.
Type accelerators have been in PowerShell since its release. PowerShell provides many built-in type accelerators allowing types to be used by a short name. Examples include Xml
for System.Xml.XmlDocument
, and ADSI
for System.DirectoryServices.DirectoryEntry
.
Types in .NET have members including constructors, properties, and methods. These are used to hold information or enact change on an object...