PS C:\Users\bob> $var.gettype()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Double System.ValueType
get-process
PS C:\Users\bob> get-typedata *ip*
TypeName Members
-------- -------
Deserialized.System.Net.IPAddress {}
System.Net.IPAddress {[IPAddressToString, System.Management.Automation.Runspaces.ScriptPropertyData]}
PS C:\Users\bob> [ipaddress]'10.0.0.1'
Address : 16777226
AddressFamily : InterNetwork
ScopeId :
IsIPv6Multicast : False
IsIPv6LinkLocal : False
IsIPv6SiteLocal : False
IsIPv6Teredo : False
IsIPv4MappedToIPv6 : False
IPAddressToString : 10.0.0.1
PS C:\Users\bob> [ipaddress]'256.0.0.1'
Cannot convert value "256.0.0.1" to type "System.Net.IPAddress". Error: "An invalid IP address was specified."
At line:1 char:1
+ [ipaddress]'256.0.0.1'
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
PS C:\Users\bob> get-typedata *mail*
TypeName Members
-------- -------
Deserialized.System.Net.Mail.MailAddress {}
System.Net.Mail.MailAddress {}
PS C:\Users\bob> [mailaddress]'bob@gmail.com'
DisplayName User Host Address
----------- ---- ---- -------
bob gmail.com bob@gmail.com
PS C:\Users\bob> [mailaddress]'bobgmail.com'
Cannot convert value "bobgmail.com" to type "System.Net.Mail.MailAddress". Error: "The specified string is not in the
form required for an e-mail address."
At line:1 char:1
+ [mailaddress]'bobgmail.com'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastConstructorException
PS C:\Users\bob> get-psdrive
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Alias Alias
C 228.46 701.70 FileSystem C:\ Users\bob
Cert Certificate \
Env Environment
Function Function
HKCU Registry HKEY_CURRENT_USER
HKLM Registry HKEY_LOCAL_MACHINE
Variable Variable
WSMan WSMan
PS C:\Users\bob> cd variable:
PS Variable:\> get-childitem
PS C:\Users\bob> [ipaddress]'256.0.0.1'
Cannot convert value "256.0.0.1" to type "System.Net.IPAddress". Error: "An invalid IP address was specified."
At line:1 char:1
+ [ipaddress]'256.0.0.1'
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocation
PS C:\Users\bob> get-typedata *mail*
TypeName Members
-------- -------
Deserialized.System.Net.Mail.MailAddress {}
System.Net.Mail.MailAddress {}
PS C:\Users\bob> [mailaddress]'bob@gmail.com'
DisplayName User Host Address
----------- ---- ---- -------
bob gmail.com bob@gmail.com
PS C:\Users\bob> [mailaddress]'bobgmail.com'
Cannot convert value "bobgmail.com" to type "System.Net.Mail.MailAddress". Error: "The specified string is not in the
form required for an e-mail address."
At line:1 char:1
+ [mailaddress]'bobgmail.com'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastConstructorException
PS C:\Users\bob> get-psdrive
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Alias Alias
C 228.46 701.70 FileSystem C:\ Users\bob
Cert Certificate \
Env Environment
Function Function
HKCU Registry HKEY_CURRENT_USER
HKLM Registry HKEY_LOCAL_MACHINE
Variable Variable
WSMan WSMan
PS C:\Users\bob> cd variable:
PS Variable:\> get-childitem
display all existing variable
PS Variable:\> cd Env:
PS Env:\> ls
display all environment variable
PS Env:\> $env:windir
C:\WINDOWS
ls | select -last 1 | fl *
ls | select -last 1 | select *
ls | select -last 1 | get-members
PS Variable:\> cd Env:
PS Env:\> ls
display all environment variable
PS Env:\> $env:windir
C:\WINDOWS
ls | select -last 1 | fl *
ls | select -last 1 | select *
ls | select -last 1 | get-members
No comments:
Post a Comment