Debian Codegraph @

test/integration/targets/powershell_exec_wrapper/module_utils/Ansible.ModuleUtils.ScopedUtil.psm1

raw
1 using namespace System.Security.Cryptography.X509Certificates
2 using namespace Invalid.Namespace.That.Does.Not.Exist
3
4 $var = 'bar'
5
6 Function Test-ScopedUtil {
7 <#
8 .SYNOPSIS
9 Test out module util scoping.
10 #>
11 [CmdletBinding()]
12 param ()
13
14 $missingUsingNamespace = $false
15 try {
16 # exec_wrapper does 'using namespace System.IO'. This ensures that this
17 # hasn't persisted to the module scope and it has it's own set of using
18 # types.
19 $null = [File]::Exists('test')
20 }
21 catch {
22 $missingUsingNamespace = $true
23 }
24
25 [PSCustomObject]@{
26 script_var = $script:var
27 module_using_namespace = ([X509Certificate2].FullName)
28 missing_using_namespace = $missingUsingNamespace
29 }
30 }
31
32 Export-ModuleMember -Function Test-ScopedUtil