@@ -545,7 +545,7 @@ Function Uninstall-LTService{
545
545
This will uninstall the LabTech agent using the provided server URL to download the uninstallers.
546
546
547
547
. NOTES
548
- Version: 1.7
548
+ Version: 1.8
549
549
Author: Chris Taylor
550
550
Website: labtechconsulting.com
551
551
Creation Date: 3/14/2016
@@ -579,6 +579,9 @@ Function Uninstall-LTService{
579
579
Update Date: 1/21/2019
580
580
Purpose/Change: Minor bugfixes/adjustments.
581
581
Allow single label server name.
582
+
583
+ Update Date: 2/28/2019
584
+ Purpose/Change: Update to try both http and https method if not specified for Server
582
585
583
586
. LINK
584
587
http://labtechconsulting.com
@@ -670,7 +673,8 @@ Function Uninstall-LTService{
670
673
If (-not ($Server )){
671
674
$Server = Read-Host - Prompt ' Provide the URL to your LabTech server (https://lt.domain.com):'
672
675
}
673
- Foreach ($Svr in $Server ) {
676
+ $Server = ForEach ($Svr in $Server ) {$Svr ; If ($Svr -notmatch ' https?://.+' ) {" https://$ ( $Svr ) " }}
677
+ ForEach ($Svr in $Server ) {
674
678
If (-not ($GoodServer )) {
675
679
If ($Svr -match ' ^(https?://)?(([12]?[0-9]{1,2}\.){3}[12]?[0-9]{1,2}|[a-z0-9][a-z0-9_-]+(\.[a-z0-9][a-z0-9_-]*)*)$' ) {
676
680
Try {
@@ -942,7 +946,7 @@ Function Install-LTService{
942
946
This will install the LabTech agent using the provided Server URL, Password, and LocationID.
943
947
944
948
. NOTES
945
- Version: 1.9
949
+ Version: 2.0
946
950
Author: Chris Taylor
947
951
Website: labtechconsulting.com
948
952
Creation Date: 3/14/2016
@@ -984,6 +988,9 @@ Function Install-LTService{
984
988
Purpose/Change: Minor bugfixes/adjustments.
985
989
Allow single label server name, accept Agent ID 1 as valid.
986
990
991
+ Update Date: 2/28/2019
992
+ Purpose/Change: Update to try both http and https method if not specified for Server
993
+
987
994
. LINK
988
995
http://labtechconsulting.com
989
996
#>
@@ -1104,7 +1111,8 @@ Function Install-LTService{
1104
1111
if (-not ($TrayPort ) -or -not ($TrayPort -ge 1 -and $TrayPort -le 65535 )){
1105
1112
$TrayPort = " 42000"
1106
1113
}
1107
- Foreach ($Svr in $Server ) {
1114
+ $Server = ForEach ($Svr in $Server ) {$Svr ; If ($Svr -notmatch ' https?://.+' ) {" https://$ ( $Svr ) " }}
1115
+ ForEach ($Svr in $Server ) {
1108
1116
If (-not ($GoodServer )) {
1109
1117
If ($Svr -match ' ^(https?://)?(([12]?[0-9]{1,2}\.){3}[12]?[0-9]{1,2}|[a-z0-9][a-z0-9_-]+(\.[a-z0-9][a-z0-9_-]*)*)$' ) {
1110
1118
If ($Svr -notmatch ' https?://.+' ) {$Svr = " http://$ ( $Svr ) " }
0 commit comments