Last active
June 2, 2020 19:53
-
-
Save btipling/ee096da8b794deab6d621bf9b8ec41c4 to your computer and use it in GitHub Desktop.
Revisions
-
btipling revised this gist
Jun 2, 2020 . 2 changed files with 28 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ PS C:\Users\swart\projects\powershell_scripts> .\get_remote_data.ps1 PS C:\Users\swart\projects\powershell_scripts> Find-RemoteData -Name "bar" 10 PS C:\Users\swart\projects\powershell_scripts> Find-RemoteData -Name "foo" 3 PS C:\Users\swart\projects\powershell_scripts> (Find-RemoteData -Name "bar") + (Find-RemoteData -Name "foo") 13 PS C:\Users\swart\projects\powershell_scripts> Read-RemoteData foo bar --- --- 3 10 This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ $global:dataURL = "https://gist.github.com/btipling/ee096da8b794deab6d621bf9b8ec41c4/raw/d46f89efa3059c1e3915dafe5b438f4e41bcf859/foo.json" function global:Read-RemoteData() { Invoke-RestMethod -Uri $global:dataURL } function global:Find-RemoteData([string]$Name) { $response = Invoke-WebRequest -Uri $global:dataURL $data = $response.Content | ConvertFrom-Json -AsHashtable [int] $data[$Name] } -
btipling revised this gist
Jun 2, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ { "foo": 3, "bar": 10 } -
btipling created this gist
Jun 2, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ { "name": "foo", "value": 2 }