https://projects.raspberrypi.org/en/projects/astro-pi-flight-data-analysis/6
View wahapediaDownload.ps1
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
$baseUri = "http://wahapedia.ru/wh40k9ed/" | |
$r = (Invoke-WebRequest -Uri "$($baseUri)Last_update.csv" -UseBasicParsing).Content | ConvertFrom-Csv -Delimiter "|" -Header "last_update" | Select-Object -Skip 1 | |
$lastUpdated = $r.last_update | |
$factions = (Invoke-WebRequest -Uri "$($baseUri)Factions.csv" -UseBasicParsing).Content | ConvertFrom-Csv -Delimiter "|" -Header "id", "name", "link" | Select-Object -Skip 1 | |
$datasheets = (Invoke-WebRequest -Uri "$($baseUri)Datasheets.csv" -UseBasicParsing).Content | ConvertFrom-Csv -Delimiter "|" -Header "id", "name", "link", "faction_id", "source_id", "role", "unit_composition", "transport", "power_points", "priest", "psyker", "open_play_only", "crusade_only", "virtual", "cost_per_unit", "Cost" | Select-Object -Skip 1 | |
$wargear = (Invoke-WebRequest -Uri "$($baseUri)Wargear_list.csv" -UseBasicParsing).Content | ConvertFrom-Csv -Delimiter "|" -Header "id", "name", "type", "description", "source_id", "is_relic", "faction_id", "legend" | Select-Object -Skip 1 | |
$datasheetWargear = |
View image.m
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
let | |
Source = Web.BrowserContents("https://rpi-imager-stats.raspberrypi.org"), | |
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", "DIV.row:nth-child(3) > DIV.col-sm:nth-child(1) > TABLE.table.mt-4 > * > TR > :nth-child(1)"}, {"Column2", "DIV.row:nth-child(3) > DIV.col-sm:nth-child(1) > TABLE.table.mt-4 > * > TR > :nth-child(2)"}}, [RowSelector="DIV.row:nth-child(3) > DIV.col-sm:nth-child(1) > TABLE.table.mt-4 > * > TR"]), | |
#"Promoted Headers" = Table.PromoteHeaders(#"Extracted Table From Html", [PromoteAllScalars=true]), | |
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Image", type text}, {"Percentage", Percentage.Type}}), | |
#"Add Timestamp" = Table.AddColumn(#"Changed Type", "Timestamp", each DateTime.LocalNow(), type datetime) | |
in | |
#"Add Timestamp" |
View googlepbi.ps1
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
$apikey = "" | |
$baseUri = "https://www.googleapis.com/customsearch/v1" | |
$cx = "" | |
$query = "site:https://app.powerbi.com" | |
function GetSearchResults([string]$start) | |
{ | |
$uri = "$($baseUri)?key=$($apikey)&cx=$($cx)&q=$($query)&start=$($start)" | |
$c = Invoke-WebRequest -Uri $uri -UseBasicParsing -Method Get |
View TabularEditor.ps1
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
# Download URL for the latest Tabular Editor portable: | |
$TabularEditorUrl = Invoke-RestMethod -uri https://api.github.com/repos/otykier/TabularEditor/releases/latest | select -ExpandProperty assets | select -expand browser_download_url | ? { $_.Contains("Portable")} | |
# Download destination (root of PowerShell script execution path): | |
$DownloadDestination = join-path (get-location) "TabularEditor.zip" | |
# Download from GitHub: | |
Invoke-WebRequest -Uri $TabularEditorUrl -OutFile $DownloadDestination | |
# Unzip Tabular Editor portable, and then delete the zip file: |
View Cleanup.ps1
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
$removeList = (Invoke-WebRequest -Uri https://gist.githubusercontent.com/matt40k/92b2aefd89f0002c0617cb1c5c9404e0/raw/RemoveList.txt -UseBasicParsing).Content | |
foreach ($removeItem in $removeList) | |
{ | |
Write-Host $removeItem | |
Get-appxpackage $removeItem.Trim() -AllUsers | Remove-appxpackage -AllUsers | |
} |
View Headless.ps1
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
$chromeExe = '"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"' | |
$outputDir = "C:\Temp\" | |
function GetScreenshot($fileName, $url) | |
{ | |
$command = @' | |
cmd.exe /C $chromeExe --headless --disable-gpu --screenshot="$outputDir\$fileName.png" --window-size=1920,1024 $url | |
'@ | |
Invoke-Expression -Command:$command | |
} |
View sqlFromRDL.ps1
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
<# | |
.SYNOPSIS | |
Extract T-SQL code from multiple RDL files | |
.NOTES | |
Author : Arvind Shyamsundar (arvindsh@microsoft.com) | |
.PARAMETERS | |
-RootFolder: full path to the root folder which contains the RDL files | |
-Recurse: whether to search sub folders or not |
View FindDecimalErrors.sql
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
select | |
concat('select top 10 [', c.name, '] from [', schema_name(t.schema_id), '].[', t.name, '] where [', c.name, '] like ''%.%'' and [', c.name, '] not like ''%.0%''') | |
from | |
sys.tables t | |
inner join sys.columns c on | |
t.object_id = c.object_id | |
inner join sys.types ty on | |
c.user_type_id = ty.user_type_id | |
and ty.name = 'decimal' |
View GetTenantId.ps
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
$domain = "microsoft.com" | |
$tenantId = (Invoke-WebRequest -UseBasicParsing https://login.windows.net/$domain/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split('/')[3] | |
Write-Host $tenantId |
NewerOlder