]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Merge branch 'main' of github.com:edthedev/dotfiles into main
authorEdTheDev <edward@delaporte.us>
Mon, 6 Nov 2023 01:43:03 +0000 (19:43 -0600)
committerEdTheDev <edward@delaporte.us>
Mon, 6 Nov 2023 01:43:03 +0000 (19:43 -0600)
psmodules/house_shopping.md [new file with mode: 0644]
psmodules/house_shopping.psm1 [new file with mode: 0644]

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