https://github.com/pldmgg/BootstrapPowerShellCore
Functions to install PowerShell Core on a Remote Host. Opitionally configure pwsh PSRemoting on the Remote Host. All you need is ssh.
https://github.com/pldmgg/BootstrapPowerShellCore
Last synced: 4 months ago
JSON representation
Functions to install PowerShell Core on a Remote Host. Opitionally configure pwsh PSRemoting on the Remote Host. All you need is ssh.
- Host: GitHub
- URL: https://github.com/pldmgg/BootstrapPowerShellCore
- Owner: pldmgg
- License: mit
- Created: 2018-10-04T21:30:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-14T18:16:39.000Z (over 6 years ago)
- Last Synced: 2024-08-14T07:06:39.020Z (8 months ago)
- Language: PowerShell
- Homepage:
- Size: 3.59 MB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - pldmgg/BootstrapPowerShellCore - Functions to install PowerShell Core on a Remote Host. Opitionally configure pwsh PSRemoting on the Remote Host. All you need is ssh. (PowerShell)
README
[](https://ci.appveyor.com/project/pldmgg/BootstrapPowerShellCore/branch/master)
# BootstrapPowerShellCore
This Module allows you to install PowerShell Core on a Remote Host and optionally configure pwsh for PSRemoting. The only requirement is that you have ssh available on your local workstation. (See my [WinSSH Module](https://github.com/pldmgg/WinSSH) if you would like an easy way to install/configure OpenSSH on Windows)The target Remote Host can be (almost) any Operating System mentioned in Microsoft's official documentation (with the exception of Kali): https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell?view=powershell-6
The Module itself can be installed and imported using Windows PowerShell 5.1 or and Powershell Core 6.X (Windows or Linux).
I will eventually add support for Kali.
## Getting Started
```powershell
# One time setup
# Download the repository
# Unblock the zip
# Extract the BootstrapPowerShellCore folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)
# Or, with PowerShell 5 or later or PowerShellGet:
Install-Module BootstrapPowerShellCore# Import the module.
Import-Module BootstrapPowerShellCore # Alternatively, Import-Module# Get commands in the module
Get-Command -Module BootstrapPowerShellCore# Get help
Get-Help -Full
Get-Help about_BootstrapPowerShellCore
```## Examples
### Scenario 1: Install pwsh on Remote Host
```powershell
$BootstrapPwshSplatParams = @{
RemoteHostNameOrIP = "zerowin16sshb"
DomainUserName = "zero\zeroadmin"
DomainPasswordSS = $(Read-Host -Prompt "Enter password" -AsSecureString)
}
Bootstrap-PowerShellCore @BootstrapPwshSplatParams
```### Scenario 2: Install pwsh AND configure sshd_config for PSRemoting...
```powershell
$BootstrapPwshSplatParams = @{
RemoteHostNameOrIP = "centos7nodomain"
LocalUserName = "centos7nodomain\vagrant"
LocalPasswordSS = $(Read-Host -Prompt "Enter password" -AsSecureString)
ConfigurePSRemoting = $True
}
Bootstrap-PowerShellCore @BootstrapPwshSplatParams
```### Scenario 3: Install pwsh using the latest package from GitHub (as opposed to the Package Management system of the target OS)
```powershell
$BootstrapPwshSplatParams = @{
RemoteHostNameOrIP = "centos7nodomain"
LocalUserName = "centos7nodomain\vagrant"
LocalPasswordSS = $(Read-Host -Prompt "Enter password" -AsSecureString)
UsePackageManagement = $False
}
Bootstrap-PowerShellCore @BootstrapPwshSplatParams
```## Notes
* PSGallery: https://www.powershellgallery.com/packages/BootstrapPowerShellCore