From 01562e3f5196b45a234285c4413320ea7315744f Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 17 Jan 2018 15:49:05 -0800 Subject: [PATCH 1/2] about_Type_Operators issues #1915 --- .../About/about_Type_Operators.md | 19 +++++++++++++------ .../About/about_Type_Operators.md | 19 +++++++++++++------ .../About/about_Type_Operators.md | 19 +++++++++++++------ .../About/about_Type_Operators.md | 19 +++++++++++++------ .../About/about_Type_Operators.md | 19 +++++++++++++------ 5 files changed, 65 insertions(+), 30 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 531eb8a2f9d..1f308fe92e0 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -22,7 +22,7 @@ TRUE otherwise. The -as operator tries to convert the input object to the specified .NET Framework type. If it succeeds, it returns the converted object. It if -fails, it returns nothing. It does not return an error. +fails, it returns \$null. It does not return an error. The following table lists the type operators in Windows PowerShell. @@ -57,11 +57,18 @@ example, to specify System.Diagnostics.Process, enter [System.Diagnostics.Process], [Diagnostics.Process], or "diagnostics.process". -The type operators always return a Boolean value, even if the input is a -collection of objects. However, when the input is a collection, the type -operators match the .NET Framework type of the collection. They do not -match the type of each object, even when all of the objects are of the same -type. +The Boolean type operators (-is and -isNot) always return a Boolean value, +even if the input is a collection of objects. The type operators always +operate on the input object as a whole. That is, if the input object is a +collection, it is the _collection_ type that is tested, not the types of the +collection's _elements_. + +If the \ is a type that is _derived_ from the \[.NET Type\] `-is` +returns`$True`. If the \ is a type that is _derived_ from the \[.NET +Type\] `-as` _passes through_ converts the input to the target type. For +example, `(Get-Item /) -is [System.IO.FileSystemInfo]` returns `$True`, +because the type of the input, `[System.IO.DirectoryInfo]`, is _derived_ from +the `[System.IO.FileSystemInfo]`. To find the .NET Framework type of an object, use the Get-Member cmdlet. Or, use the GetType method of all the objects together with the FullName diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 531eb8a2f9d..1f308fe92e0 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -22,7 +22,7 @@ TRUE otherwise. The -as operator tries to convert the input object to the specified .NET Framework type. If it succeeds, it returns the converted object. It if -fails, it returns nothing. It does not return an error. +fails, it returns \$null. It does not return an error. The following table lists the type operators in Windows PowerShell. @@ -57,11 +57,18 @@ example, to specify System.Diagnostics.Process, enter [System.Diagnostics.Process], [Diagnostics.Process], or "diagnostics.process". -The type operators always return a Boolean value, even if the input is a -collection of objects. However, when the input is a collection, the type -operators match the .NET Framework type of the collection. They do not -match the type of each object, even when all of the objects are of the same -type. +The Boolean type operators (-is and -isNot) always return a Boolean value, +even if the input is a collection of objects. The type operators always +operate on the input object as a whole. That is, if the input object is a +collection, it is the _collection_ type that is tested, not the types of the +collection's _elements_. + +If the \ is a type that is _derived_ from the \[.NET Type\] `-is` +returns`$True`. If the \ is a type that is _derived_ from the \[.NET +Type\] `-as` _passes through_ converts the input to the target type. For +example, `(Get-Item /) -is [System.IO.FileSystemInfo]` returns `$True`, +because the type of the input, `[System.IO.DirectoryInfo]`, is _derived_ from +the `[System.IO.FileSystemInfo]`. To find the .NET Framework type of an object, use the Get-Member cmdlet. Or, use the GetType method of all the objects together with the FullName diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 531eb8a2f9d..1f308fe92e0 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -22,7 +22,7 @@ TRUE otherwise. The -as operator tries to convert the input object to the specified .NET Framework type. If it succeeds, it returns the converted object. It if -fails, it returns nothing. It does not return an error. +fails, it returns \$null. It does not return an error. The following table lists the type operators in Windows PowerShell. @@ -57,11 +57,18 @@ example, to specify System.Diagnostics.Process, enter [System.Diagnostics.Process], [Diagnostics.Process], or "diagnostics.process". -The type operators always return a Boolean value, even if the input is a -collection of objects. However, when the input is a collection, the type -operators match the .NET Framework type of the collection. They do not -match the type of each object, even when all of the objects are of the same -type. +The Boolean type operators (-is and -isNot) always return a Boolean value, +even if the input is a collection of objects. The type operators always +operate on the input object as a whole. That is, if the input object is a +collection, it is the _collection_ type that is tested, not the types of the +collection's _elements_. + +If the \ is a type that is _derived_ from the \[.NET Type\] `-is` +returns`$True`. If the \ is a type that is _derived_ from the \[.NET +Type\] `-as` _passes through_ converts the input to the target type. For +example, `(Get-Item /) -is [System.IO.FileSystemInfo]` returns `$True`, +because the type of the input, `[System.IO.DirectoryInfo]`, is _derived_ from +the `[System.IO.FileSystemInfo]`. To find the .NET Framework type of an object, use the Get-Member cmdlet. Or, use the GetType method of all the objects together with the FullName diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 531eb8a2f9d..1f308fe92e0 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -22,7 +22,7 @@ TRUE otherwise. The -as operator tries to convert the input object to the specified .NET Framework type. If it succeeds, it returns the converted object. It if -fails, it returns nothing. It does not return an error. +fails, it returns \$null. It does not return an error. The following table lists the type operators in Windows PowerShell. @@ -57,11 +57,18 @@ example, to specify System.Diagnostics.Process, enter [System.Diagnostics.Process], [Diagnostics.Process], or "diagnostics.process". -The type operators always return a Boolean value, even if the input is a -collection of objects. However, when the input is a collection, the type -operators match the .NET Framework type of the collection. They do not -match the type of each object, even when all of the objects are of the same -type. +The Boolean type operators (-is and -isNot) always return a Boolean value, +even if the input is a collection of objects. The type operators always +operate on the input object as a whole. That is, if the input object is a +collection, it is the _collection_ type that is tested, not the types of the +collection's _elements_. + +If the \ is a type that is _derived_ from the \[.NET Type\] `-is` +returns`$True`. If the \ is a type that is _derived_ from the \[.NET +Type\] `-as` _passes through_ converts the input to the target type. For +example, `(Get-Item /) -is [System.IO.FileSystemInfo]` returns `$True`, +because the type of the input, `[System.IO.DirectoryInfo]`, is _derived_ from +the `[System.IO.FileSystemInfo]`. To find the .NET Framework type of an object, use the Get-Member cmdlet. Or, use the GetType method of all the objects together with the FullName diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 531eb8a2f9d..1f308fe92e0 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -22,7 +22,7 @@ TRUE otherwise. The -as operator tries to convert the input object to the specified .NET Framework type. If it succeeds, it returns the converted object. It if -fails, it returns nothing. It does not return an error. +fails, it returns \$null. It does not return an error. The following table lists the type operators in Windows PowerShell. @@ -57,11 +57,18 @@ example, to specify System.Diagnostics.Process, enter [System.Diagnostics.Process], [Diagnostics.Process], or "diagnostics.process". -The type operators always return a Boolean value, even if the input is a -collection of objects. However, when the input is a collection, the type -operators match the .NET Framework type of the collection. They do not -match the type of each object, even when all of the objects are of the same -type. +The Boolean type operators (-is and -isNot) always return a Boolean value, +even if the input is a collection of objects. The type operators always +operate on the input object as a whole. That is, if the input object is a +collection, it is the _collection_ type that is tested, not the types of the +collection's _elements_. + +If the \ is a type that is _derived_ from the \[.NET Type\] `-is` +returns`$True`. If the \ is a type that is _derived_ from the \[.NET +Type\] `-as` _passes through_ converts the input to the target type. For +example, `(Get-Item /) -is [System.IO.FileSystemInfo]` returns `$True`, +because the type of the input, `[System.IO.DirectoryInfo]`, is _derived_ from +the `[System.IO.FileSystemInfo]`. To find the .NET Framework type of an object, use the Get-Member cmdlet. Or, use the GetType method of all the objects together with the FullName From 4589c09e7d54a662d0024870eb9bb9a5b95bb91a Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 18 Jan 2018 15:55:30 -0800 Subject: [PATCH 2/2] fix typos --- .../Microsoft.PowerShell.Core/About/about_Type_Operators.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 1f308fe92e0..418b3da5606 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -63,9 +63,9 @@ operate on the input object as a whole. That is, if the input object is a collection, it is the _collection_ type that is tested, not the types of the collection's _elements_. -If the \ is a type that is _derived_ from the \[.NET Type\] `-is` +If the \ is a type that is _derived_ from the \[.NET Type\], `-is` returns`$True`. If the \ is a type that is _derived_ from the \[.NET -Type\] `-as` _passes through_ converts the input to the target type. For +Type\] `-as` converts the input to the target type. For example, `(Get-Item /) -is [System.IO.FileSystemInfo]` returns `$True`, because the type of the input, `[System.IO.DirectoryInfo]`, is _derived_ from the `[System.IO.FileSystemInfo]`.