From: EdTheDev Date: Sun, 19 Nov 2023 03:40:27 +0000 (-0600) Subject: Prototype location finder X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/e7972458e707b1ca21bc8e26c35771f78f585c30 Prototype location finder --- diff --git a/psmodules/house_shopping.psm1 b/psmodules/house_shopping.psm1 index 819194b..f58c4d8 100644 --- a/psmodules/house_shopping.psm1 +++ b/psmodules/house_shopping.psm1 @@ -1,6 +1,49 @@ -function Get-TravelTimes() { +function Add-Address(){ + Param( + [string]$addressFile = "Addresses.csv" + [string]$outFile= "Address_Details.csv" + ) + $addressList = Get-Content $addressFile | ConvertFrom-Csv + $details = Get-Content $outFile| ConvertFrom-Csv + + $addressList | ForEach-Object { + if($details -NotContains $_.Address) + { + $details.Address = $_.Address + $details.SqFt = $_.SqFt + $details.Cost = $_.Cost + } + } + $details | Export-Csv -NoTypeInformation -Path $outFile + Write-Host "Updated $outFile" +} + + +function Add-AddressLocations(){ + Param( + [string]$outFile= "Address_Details.csv" + ) + $details = Get-Content $outFile| ConvertFrom-Csv + $details | ForEach-Object { + if($_.Lat -eq '') + { + $posit = Get-MapCoords -Address $_.Address + $_.Lat = $posit.Lat + $_.Lon = $posit.Lon + } + } + $details | Export-Csv -NoTypeInformation -Path $outFile + Write-Host "Updated $outFile" +} + + +function Add-TravelTimes() { + Param( + [string]$outFile= "Address_Details.csv" + ) + $details = Get-Content $outFile| ConvertFrom-Csv }