PoshCode Archive  Artifact Content

Artifact 469ffa9cfdef85fe6dd8e8010a3ddb74e9e74de0d7ee41ec26e6475e9580db10:

  • File Write-ScriptVariables.ps1 — part of check-in [84ed7f4fde] at 2018-06-10 13:31:55 on branch trunk — Print variables defined in the script (excludes global vars) (user: Ryan Smith size: 593)

# encoding: ascii
# api: powershell
# title: Write-ScriptVariables
# description: Print variables defined in the script (excludes global vars)
# version: 0.1
# type: function
# author: Ryan Smith
# license: CC0
# function: Write-ScriptVariables
# x-poshcode-id: 3836
# x-archived: 2012-12-22T08:33:40
# x-published: 2012-12-19T12:33:00
#
#
function Write-ScriptVariables {
   $globalVars = get-variable -scope Global | % { $_.Name }
   Get-Variable -scope Script | Where-Object { $globalVars -notcontains $_.Name } | Where-Object { $_.Name -ne 'globalVars' } | Out-String	
}