PureIT

Let’s start with Powershell – part2

Excercise – Solved

PS C:\> $a=3
PS C:\> write-host $a
3
PS C:\> $a.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Int32                                    System.ValueType

PS C:\> $b=3.3
PS C:\> Write-Host $b
3.3
PS C:\> $c="3.3"
PS C:\> Write-Host $c
3.3
PS C:\> $b.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Double                                   System.ValueType

PS C:\> $c.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     String                                   System.Object

PS C:\> $d=$a+$b
PS C:\> $d
6.3
PS C:\> $d.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Double                                   System.ValueType

PS C:\> $x=3.4
PS C:\> $x
3.4
PS C:\> $x.ToInt32($null)
3
PS C:\> $y=3.6
PS C:\> $y.ToInt32($null)
4

Pages: 1 2 3 4
4 January 2020 Powershell System Tutorial
1 Comment

Let's start with Powershell - part1

Let’s start with Powershell - part 3

  1. Pingback: Let’s start with Powershell - part 3 - PureIT
Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Let’s start with Powershell – part 3
  • Let’s start with Powershell – part2
  • Let’s start with Powershell – part1

Recent Comments

  • Let’s start with Powershell - part 3 - PureIT on Let’s start with Powershell – part2
  • Let’s start with Powershell - part 3 - PureIT on Let’s start with Powershell – part1
  • Let’s start with Powershell part2 – PureIT on Let’s start with Powershell – part1

Archives

  • January 2020

Categories

  • Microsoft
  • Powershell
  • System
  • Tutorial

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress | Theme: Neblue by NEThemes.