Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
Created May 22, 2020 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamdriscoll/c7a6bbd24eb86ee3333671e54b4bb26d to your computer and use it in GitHub Desktop.
Save adamdriscoll/c7a6bbd24eb86ee3333671e54b4bb26d to your computer and use it in GitHub Desktop.
Scoping issue
Import-Module .\module.psm1
function New-ComponentPage {
param(
$Page
)
New-Page
}
.\script.ps1
function New-Page {
Get-Variable
}
PS C:\Users\adamr\Desktop> c:\Users\adamr\Desktop\dashboard.ps1
Name Value
---- -----
$
? True
^
args {}
ConfirmPreference High
ConsoleFileName
DebugPreference SilentlyContinue
Error {}
ErrorActionPreference Continue
ErrorView NormalView
ExecutionContext System.Management.Automation.EngineIntrinsics
false False
FormatEnumerationLimit 4
HOME C:\Users\adamr
Host System.Management.Automation.Internal.Host.InternalHost
InformationPreference SilentlyContinue
input System.Collections.ArrayList+ArrayListEnumeratorSimple
MaximumAliasCount 4096
MaximumDriveCount 4096
MaximumErrorCount 256
MaximumFunctionCount 4096
MaximumHistoryCount 4096
MaximumVariableCount 4096
module PSReadLine
MyInvocation System.Management.Automation.InvocationInfo
NestedPromptLevel 0
null
OutputEncoding System.Text.ASCIIEncoding
PID 16924
profile C:\Users\adamr\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1
ProgressPreference Continue
PSBoundParameters {}
PSCommandPath C:\Users\adamr\Desktop\module.psm1
PSCulture en-US
PSDefaultParameterValues {}
PSEdition Desktop
psEditor Microsoft.PowerShell.EditorServices.Extensions.EditorObject
PSEmailServer
PSHOME C:\Windows\System32\WindowsPowerShell\v1.0
PSScriptRoot C:\Users\adamr\Desktop
PSSessionApplicationName wsman
PSSessionConfigurationName http://schemas.microsoft.com/powershell/Microsoft.PowerShell
PSSessionOption System.Management.Automation.Remoting.PSSessionOption
PSUICulture en-US
PSVersionTable {PSVersion, PSEdition, PSCompatibleVersions, BuildVersion...}
PWD C:\Users\adamr\Desktop
ShellId Microsoft.PowerShell
StackTrace
StorageHistoryCharts {}
true True
VerbosePreference SilentlyContinue
WarningPreference Continue
WhatIfPreference False
New-ComponentPage -Page "Test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment