-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery.ps1
More file actions
45 lines (36 loc) · 1.11 KB
/
Query.ps1
File metadata and controls
45 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function global:Invoke-ExecuteQuery()
{
param(
[string] $query,
[string] $message
)
$config = Get-Content "$CurrentExtensionDataPath\config.json"| ConvertFrom-Json
$DS4CMDExecutablePath = ($config.DS4CMDLocation -split '=')[-1]
$responce = & $DS4CMDExecutablePath -command Query.1.$query
$PlayniteApi.Dialogs.ShowMessage($message + $responce)
}
function global:QueryProfileName()
{
Invoke-ExecuteQuery "ProfileName" "Your current profile is: "
}
function global:QueryOutContType()
{
Invoke-ExecuteQuery "OutContType" "Your current emulated controller type is: "
}
function global:QueryDisplayName()
{
Invoke-ExecuteQuery "DisplayName" "Your current controllers' name is: "
}
function global:QueryConnType()
{
Invoke-ExecuteQuery "ConnType" "Your current connection type is: "
}
function global:QueryBattery()
{
Invoke-ExecuteQuery "Battery" "Your current battery level is: "
Invoke-ExecuteQuery "Charging" "Your controller is charging? "
}
# function global:QueryCharging ()
# {
# Invoke-ExecuteQuery "Charging"
# }