Last active
March 27, 2024 19:54
-
-
Save santisq/e8ac828246cad0027c042641f78484c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$framework = 'netstandard2.0' | |
$folder = 'EventHubs' | |
$packages = 'Azure.Messaging.EventHubs', 'Azure.Messaging.EventHubs.Processor' | |
dotnet new classlib -f $framework -o "$folder.package" && | |
Push-Location "$folder.package" && | |
$packages | ForEach-Object { dotnet add package $_ } && | |
dotnet publish --configuration Release -o lib && | |
Add-Type -Path .\lib\*.dll && | |
Pop-Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$iwr = Invoke-WebRequest https://www.nuget.org/api/v2/package/IPNetwork2/ | |
$zip = [System.IO.Compression.ZipArchive]::new($iwr.RawContentStream) | |
$entry = $zip.GetEntry('lib/netstandard2.0/System.Net.IPNetwork.dll') | |
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $entry.Name, $true) | |
$zip.Dispose() | |
$iwr.RawContentStream.Dispose() | |
Add-Type -Path $entry.Name | |
[System.Net.IPNetwork] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment