Skip to content

Commit b11fadb

Browse files
feat: Adding loader check to PSM1 ( Fixes #1 )
1 parent b604b86 commit b11fadb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

OpenXML.psm1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ foreach ($file in Get-ChildItem -Path $CommandsPath -Filter '*-*.ps1') {
55
}
66
. $file.FullName
77
}
8+
9+
if (-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+
}
15+
}

0 commit comments

Comments
 (0)