Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'Edit-OSDCloudWinPE -StartURL' with Blob Storage SAS URL does not work. (2 Issues) #156

Open
Vexxer1 opened this issue Aug 12, 2024 · 2 comments

Comments

@Vexxer1
Copy link

Vexxer1 commented Aug 12, 2024

Hi,
I need to store the Script we'd like to run during OSDCloud on a Microsoft Blob Storage. For that, I uploaded the script and created a (ReadOnly) SAS URL. This does not work for me, for 2 reasons:

  1. A blob storage SAS URL contains & and % characters. Since this is applied to the startnet.cmd the classic batch rules apply and those characters need to be escaped. % to %% and & to ^&. But that's something I can work around from my side when I pass the URL to Edit-OSDCloudWinPE.

  2. A more strange behaviour happens when Invoke-WebPSScript is called. The verbose output shows the URL seemingly correct to me (unless my eyes play tricks on me), but PowerShell just closes without executing the script. I tested a bit and noticed that I run into the empty return when Test-WebConnection is checking the URL, because its $false. But manually executing Test-WebConnection with my URL returned true. When I change the type of the parameter in the function Invoke-WebPSScript from [system.uri] to [string] it magically works. Which seems quite strange to me, since Test-Webconnection also changes the type to [system.uri].

@joebartlett94
Copy link

Problem number 2 sounds like it's likely caused by issue #168, which has been reverted in the repo and should be included in the next release.

In the meantime, you can either manually update your copy of the OSD module with the new version of Invoke-WebPSScript.ps1, or you can fix the issue by changing the 'CONTENT-TYPE' property of the blob in Azure from the default (application/octet-stream) to 'text/plain'.

@AkosBakos
Copy link
Collaborator

As @joebartlett94 says your second issue should be solved now.
For the first one, please try to avoid using white and/or special characters in the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants