Skip to content

Commit d2ecfbf

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: OpenPackage.Source.Url ( Fixes #119 )
Improving handling of direct package download
1 parent 6e9f998 commit d2ecfbf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OP.types.ps1xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7812,10 +7812,10 @@ foreach ($uri in $url) {
78127812
# If the web response is a byte array
78137813
if ($WebResponse.Content -is [byte[]] -and
78147814
# and starts with the magic pair of bytes indicate it might be a zip
7815-
($WebResponse.Content[0] -eq 80 -and $WebResponse.Content[-1] -eq 75)
7815+
($WebResponse.Content[0] -eq 80 -and $WebResponse.Content[1] -eq 75)
78167816
) {
78177817
# Create a stream from the response
7818-
$memoryStream = [IO.MemoryStream]::new($downloadPackage.Content)
7818+
$memoryStream = [IO.MemoryStream]::new($WebResponse.Content)
78197819
# and open the package
78207820
$currentPackage = [IO.Packaging.Package]::Open($memoryStream, 'OpenOrCreate', 'ReadWrite')
78217821
# If that did not work, it will error,

0 commit comments

Comments
 (0)