Skip to content

Commit

Permalink
Workarround or fix for TheJumpCloud#472
Browse files Browse the repository at this point in the history
  • Loading branch information
flybyray authored Feb 23, 2023
1 parent a3ddab0 commit 73c5fbc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Function New-JCCommandFromURL {

process {

# Convert GitHub url to raw url
$httpUrl = $GitHubURL | Select-String -Pattern "\bmaster.*$" | % { $_.Matches } | % { $_.Value }
$rawUrl = "https://raw.githubusercontent.com/TheJumpCloud/support/$httpUrl"
# # Convert GitHub url to raw url
# $httpUrl = $GitHubURL | Select-String -Pattern "\bmaster.*$" | % { $_.Matches } | % { $_.Value }
# $rawUrl = "https://raw.githubusercontent.com/TheJumpCloud/support/$httpUrl"

$rawUrlInvoke = Invoke-WebRequest -Uri $rawUrl -UseBasicParsing -UserAgent:(Get-JCUserAgent)
$rawUrlInvoke = Invoke-WebRequest -Uri $GitHubURL -UseBasicParsing -UserAgent:(Get-JCUserAgent)
$content = [Regex]::Matches($rawUrlInvoke.Content, '#### (Name|commandType).*[\r\n]+(.*)|#### Command[\n\r]+.*\n([\s\S]*?)```$', [System.Text.RegularExpressions.RegexOptions]::Multiline)

# Command Values
Expand Down Expand Up @@ -46,4 +46,4 @@ Function New-JCCommandFromURL {
Return $NewCommand

}
}
}

0 comments on commit 73c5fbc

Please sign in to comment.