# encoding: ascii
# api: powershell
# title: Get-StrictMode.psm1
# description: Retrieve the Set-StrictMode session setting. Use as a Module (psm1) and expose any of the user’s settings, but the ‘latest’ parameter cannot be retrieved at present.
# version: 0.1
# type: module
# author: Archdeacon
# license: CC0
# function: Get-StrictMode
# x-poshcode-id: 3136
# x-archived: 2017-05-18T12:39:04
# x-published: 2012-12-31T00:45:00
#
#
<#
.SYNOPSIS
 A very simple module to retrieve the Set-StrictMode setting of the session.
.DESCRIPTION
This procedure is necessary as there is, apparently, no PowerShell variable 
for this and enables the user setting to be returned to its original state 
after possibly being changed within a script.
The various values returned will be Version 1, Version 2, or Off.
#>
function Get-StrictMode {
   try {
      $version = '2'
      $z = "2 * $nil"       #V2 will catch this one.
      $version = '1'
      $z = 2 * $nil         #V1 will catch this.
      Write-Host "StrictMode: Off"
   }
   catch {
      Write-Host "StrictMode: Version $version"
   }
}
