FEATURE REQUEST - Install-Remotely.bat instead of Install-Remotely.ps1
- Dominant language
- C#
- Stars
- 5.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
I suspect that
```
.\Install-Remotely.ps1
.\Install-Remotely.ps1 : File C:\Users\bcurran\Downloads\Install-Remotely.ps1 cannot be loaded. The file
C:\Users\bcurran\Downloads\Install-Remotely.ps1 is not digitally signed. You cannot run this script on the current
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\Install-Remotely.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
```
is problematic for the average end user that a Remotely admin is trying to get to install the Resident Agents.... remotely.
I propose changing to an Install-Remotely.bat that
- uses powershell to download Install-Remotely.ps1
- runs powershell to execute Install-Remotely.ps1 bypassing execution policy
- deletes ./Install-Remotely.ps1
It would look something like this:
```
rem Install-Remotely.bat
echo off
powershell Invoke-WebRequest -URI https://remotely.site.tld/API/ClientDownloads/WindowsInstaller -OutFile Install-Remotely.ps1
powershell -NoProfile -ExecutionPolicy unrestricted -Command "& './Install-Remotely.ps1'"
del Install-Remotely.ps1
```
NOTE: It appears Install-Remotely.ps1 is custom made upon demand. It would need to be a statically available file and the Invoke-WebRequest above could call it directly by filename.
Alternatively you could have a copy and paste string for installation from PS similar to what [Chocolatey](https://chocolatey.org/install) uses to install their software:
`Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))`
Obviously the DownloadString would be custom per site settings....
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how Install-Remotely.ps1 is generated for the WindowsInstaller download endpoint, including whether a static file can replace the site-specific script. Compare the proposed Install-Remotely.bat flow with the PowerShell execution-policy and cleanup requirements; done means an end user can run the batch installer to download, execute, and remove the script.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100