AllowNullAttribute Class
Allows null as the argument of a mandatory cmdlet or function parameter.
Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)
System.Management.Automation Namespace
Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field)] public sealed class AllowNullAttribute : CmdletMetadataAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field) */ public final class AllowNullAttribute extends CmdletMetadataAttribute
AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field) public final class AllowNullAttribute extends CmdletMetadataAttribute
When this attribute is used null is converted to the parameter type. This means that adding AllowNull to the following parameter types is not useful.
String parameters should not use this attribute because null is converted to the empty string.
Value type parameters should not use this attribute because null is converted to 0 for numeric types, and null cannot be converted to most other value types.
System.Object
System.Attribute
System.Management.Automation.Internal.CmdletMetadataAttribute
System.Management.Automation.AllowNullAttribute
System.Attribute
System.Management.Automation.Internal.CmdletMetadataAttribute
System.Management.Automation.AllowNullAttribute
Any public static (
Shared
in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Target Platforms
Windows Developer Preview, Windows Server Developer PreviewReference
AllowNullAttribute MembersSystem.Management.Automation Namespace
Other Resources
Windows PowerShell SDKSend comments about this topic to Microsoft.
