File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,11 +7,23 @@ foreach ($file in Get-ChildItem -Path $CommandsPath -Filter '*-*.ps1') {
77}
88
99if (-not (' IO.Packaging.Package' -as [type ])) {
10- $addedTypes = Add-type - AssemblyName System.IO.Packaging - PassThru
11- $packageTypeFound = $addedTypes | Where-Object FullName -eq ' System.IO.Packaging.Package'
12- if (-not $packageTypeFound ) {
13- Write-Warning " Could not find [IO.Packaging.Package]"
14- }
10+ if ($psVersionTable.PSVersion -ge ' 6.0' ) {
11+ $addedTypes = Add-type - AssemblyName System.IO.Packaging - PassThru
12+ $packageTypeFound = $addedTypes | Where-Object FullName -eq ' System.IO.Packaging.Package'
13+ if (-not $packageTypeFound ) {
14+ Write-Warning " Could not find [System.IO.Packaging.Package]"
15+ }
16+ } else {
17+ Write-Warning (
18+ @ (
19+ " System.IO.Packaging.Package is not included with Windows PowerShell."
20+ " Please download System.IO.Packaging from Nuget:"
21+ " https://www.nuget.org/packages/System.IO.Packaging/"
22+ ) -join [Environment ]::NewLine
23+ )
24+ }
1525}
1626
17-
27+ if (-not $env: OpenPackagePath ) {
28+ $env: OpenPackagePath = Join-Path $home OpenPackage
29+ }
You can’t perform that action at this time.
0 commit comments