Skip to content

Instantly share code, notes, and snippets.

@HawaiiRyan
HawaiiRyan / GoogleChrome-AndroidUpdate.ps1
Last active April 1, 2020 22:13
Google Chrome App Update Tool - Android
######Howto use script
# 1. Create config.ini file
# 1a. Config.ini file example at following URL: https://gist.github.com/HawaiiRyan/b610f6d5427afa9609cee145affed912
# 2. Update -path location in the line where variable/object $WS1Env is declared
# 3. Ensure $addy, $b64, $apikey are referencing the correct environment.
# 3a. UAT environment is used in this example
#Set Verbosity Preference
$VerbosePreference = "Continue"
@HawaiiRyan
HawaiiRyan / insecurescript.ps1
Last active March 24, 2020 20:44
example-BadSecurity
$logpath = "C:\Hawaii\Kauai\workspaceone\tools\logs"
If(!(test-path $logpath))
{
New-Item -ItemType Directory -Force -Path $logpath
}
$applog = "$logpath\HouseBought$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv"
$addy = "https://kauai.ryanpringnitz.com"
$apiKey = "z/Model337ltuYugOcE2snK/ModelYnot?d4vHlN4hd="
$b64 = "SWNhbmhhelRlc2xhP1RoaXNQYXNzd29yZGlzSm9rZWJ1dFJlYWxseSxJd2FudEFUZXNsYQ=="
@HawaiiRyan
HawaiiRyan / moresecure.ps1
Created March 24, 2020 20:41
example-MoreSecure
###Force commuincation to only occur with TLS 1.2
Write-Verbose -Message "Forcing TLS 1.2 Cipher...."
[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12
Write-Verbose -Message "TLS 1.2 Ciper Successfully Enforced"
$filepath = Get-Location
$WS1Env = Get-Content -Path $filepath\tools\config.ini | Select -Skip 1 | ConvertFrom-StringData
$logPath = $WS1Env.logpath
@HawaiiRyan
HawaiiRyan / config.ini
Created March 24, 2020 20:41
Config.ini file to improve script security
####ini file info
#Modify the value to the right of the equal symbol
#Example
#DEVEnvironment=https://molokai.ryanpringnitz.com
####
#The data in the ini file can be referenced in the Powershell object $WS1Env
#Example with variable $WS1Env used
#$WS1Env.UATEnvironment
#This will be available for use as a string in the array
####
mode=explicit,broadcast=false,action=android.intent.action.MAIN,package=com.internal.commercialrealestateservices,class=com.internal.commercialrealestateservices.MainActivity
#Set Verbosity Preference
$VerbosePreference = "Continue"
#Require TLS 1.2 for communication
[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12
#Workspace ONE Environment Address, Authentication, and Headers
$addy = "https://ws1.ryanpringnitz.com"
@HawaiiRyan
HawaiiRyan / curl-GetPublicAppDevices Response Body
Created March 3, 2020 18:43
curl-GetPublicAppDevices Response Body
{
"DeviceId": [
53,
54,
55,
56,
57,
58,
59,
61,
@HawaiiRyan
HawaiiRyan / curl-GetPublicAppDevices
Created March 3, 2020 18:39
curl command to force public application update/installation
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json;version=1'
--header 'Authorization: Basic aWNhbmhhelRlc2xhcGx6'
--header 'aw-tenant-code: e/A6xyuU02ytaNjoecj2jnW/mq24on7lYHd9vZlP0h=q'
'https://ws1.ryanpringnitz.com/API/mam/apps/public/223/devices'
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json;version=1'
--header 'Authorization: Basic aWNhbmhhelRlc2xhcGx6'
--header 'aw-tenant-code: e/A6xyuU02ytaNjoecj2jnW/mq24on7lYHd9vZlP0h=q'
-d '{ \
"DeviceId":66 \
}' 'https://ws1.ryanpringnitz.com/API/mam/apps/public/223/install'
#Workspace ONE UEM Environment Address / Authentication
$addy = "https://ws1.molokaibank.com"
$b64 = Get-Content -Path "c:\creds\b64.txt"
$apiKey = "apikey"
$b64EncodedAuth = "$b64"
#Header
$content = "application/json"
$authHeader = "Basic " + $b64EncodedAuth
$header = @{"Authorization" = $authHeader; "aw-tenant-code" = $apiKey; "Accept" = $content; "Content-Type" = $content}