forked from torizon/vscode-torizon-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
updateGambasIni.ps1
45 lines (38 loc) · 1.07 KB
/
updateGambasIni.ps1
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
# suppress warnings that we need to use
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidOverwritingBuiltInCmdlets', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingInvokeExpression', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingPositionalParameters', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidGlobalVars', ""
)]
param()
# include
. "$(Split-Path $MyInvocation.MyCommand.Path -Parent)/utils/iniFiles.ps1"
# get arguments
$_path = $args[0]
$_deviceHostname = $args[1]
$_devicePort = $args[2]
$_projectName = $args[3]
# get the ini structured
$datas = `
Get-IniFile "$_path/$_projectName/.settings"
# debug
Write-Host $datas.Debug["RemoteServer"]
Write-Host "to"
Write-Host $_deviceHostname
# replace
$datas.Debug["RemoteServer"] = `
"`"$_deviceHostname`""
$datas.Debug["RemotePort"] = `
"$_devicePort"
# write
New-IniContent $datas | Out-File -FilePath "$_path/$_projectName/.settings"