From: EdTheDev Date: Mon, 6 Nov 2023 01:41:16 +0000 (-0600) Subject: Add WIP house shopping X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/f3b9f8b1f71334b2e64208ac1f3c2f015e9f441c?ds=sidebyside Add WIP house shopping --- diff --git a/psmodules/house_shopping.md b/psmodules/house_shopping.md new file mode 100644 index 0000000..af1c9b4 --- /dev/null +++ b/psmodules/house_shopping.md @@ -0,0 +1,33 @@ + + +## Reference + +- [Azure Maps](https://learn.microsoft.com/en-us/powershell/module/az.maps/?view=azps-10.4.1&viewFallbackFrom=azps-10.0.0) +- https://learn.microsoft.com/en-us/azure/azure-maps/how-to-search-for-address + + +https://geekeefy.wordpress.com/2016/05/17/powershell-module-for-google-map/ + +## Setup + +Make sure that PowerShell 7 or higher is installed: + +```powershell +if($PSVersionTable.PSVersion.Major < 7) { + winget install --id Microsoft.Powershell --source winget +} + +Then inside PowerShell 7, install the Az module: + +```powershell +Install-Module -Name Az -Repository PSGallery -Force +``` + +### Subscription Key + + + +Set your subscription key: +```powershell +$env:AzMapsSubKey="" +``` \ No newline at end of file diff --git a/psmodules/house_shopping.psm1 b/psmodules/house_shopping.psm1 new file mode 100644 index 0000000..d6b028e --- /dev/null +++ b/psmodules/house_shopping.psm1 @@ -0,0 +1,17 @@ + +function Get-TravelTimes() { + + +} + +$fuzzyUrl = "https://atlas.microsoft.com/search/fuzzy/json?&api-version=1.0&subscription-key={Your-Azure-Maps-Subscription-key}&language=en-US&query=pizza" + +function Get-MapAddress() { + param( + [string]$address + ) + $subKey = $env:AzMapsSubKey + $addyUrl = "https://atlas.microsoft.com/search/address/json?&subscription-key=$subKey&api-version=1.0&language=en-US&query=$address" + $result = Invoke-WebRequest $addyUrl + return $result +} \ No newline at end of file