# encoding: ascii
# api: powershell
# title: Invoke-ComplexDebuggerSc
# description: From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes
# version: 0.1
# type: script
# author: Lee Holmes
# license: CC0
# x-poshcode-id: 2177
# x-archived: 2016-03-18T23:47:17
# x-published: 2011-09-09T21:41:00
#
#
#############################################################################
##
## Invoke-ComplexDebuggerScript
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##############################################################################
<#
.SYNOPSIS
Demonstrates the functionality of PowerShell's debugging support.
#>
Set-StrictMode -Version Latest
function HelperFunction
{
$dirCount = 0
}
Write-Host "Calculating lots of complex information"
$runningTotal = 0
$runningTotal += [Math]::Pow(5 * 5 + 10, 2)
$runningTotal
$dirCount = @(Get-ChildItem $env:WINDIR).Count
$dirCount
HelperFunction
$dirCount
$runningTotal -= 10
$runningTotal /= 2
$runningTotal
$runningTotal *= 3
$runningTotal /= 2
$runningTotal