auto load system web and net (#7748)

This commit is contained in:
William Cheng 2020-10-19 13:55:43 +08:00 committed by GitHub
parent 3d337db207
commit e8ba2901df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,14 @@
{{>partial_header}}
#region Import functions
# define the following classes in PowerShell
try {
Add-Type -AssemblyName System.Web -ErrorAction Ignore | Out-Null
Add-Type -AssemblyName System.Net -ErrorAction Ignore | Out-Null
} catch {
Write-Verbose $_
}
# set $ErrorActionPreference to 'Stop' globally
$ErrorActionPreference = 'Stop'

View File

@ -7,6 +7,14 @@
#region Import functions
# define the following classes in PowerShell
try {
Add-Type -AssemblyName System.Web -ErrorAction Ignore | Out-Null
Add-Type -AssemblyName System.Net -ErrorAction Ignore | Out-Null
} catch {
Write-Verbose $_
}
# set $ErrorActionPreference to 'Stop' globally
$ErrorActionPreference = 'Stop'