Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

(Chore) : Added new prerequisite permission to run ps1 scripts. #77

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/handlers/Utilities/Prerequisites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export const WindowsPrerequisites: AppModel[] = [
getAppModel('wsl', 'Windows Subsystem for Linux (WSL)', 'wsl --status;', false),
getAppModel('wslUbuntu', 'WSL Ubuntu Distribution', 'wsl --status;', false),
getAppModel('dockerDesktop', 'Docker Desktop', 'docker version;', false),
getAppModel('dockerDesktopUbuntu', 'Docker Desktop WSL Ubuntu Integration', 'wsl docker version;', false)
getAppModel('dockerDesktopUbuntu', 'Docker Desktop WSL Ubuntu Integration', 'wsl docker version;', false),
getAppModel('ps1ExecutionPolicy', 'PowerShell execution policy', 'Get-ExecutionPolicy;', false)
Abhijay007 marked this conversation as resolved.
Show resolved Hide resolved
]
2 changes: 1 addition & 1 deletion src/main/handlers/Utilities/Utilities.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Utilities {
}

if (
(prerequisite.id === 'wsl' && stdOutput) ||
(prerequisite.id === 'wsl' && stdOutput) || (prerequisite.id === 'ps1ExecutionPolicy' && stdOutput.includes('RemoteSigned')) ||
Abhijay007 marked this conversation as resolved.
Show resolved Hide resolved
(prerequisite.id === 'wslUbuntu' && stdOutput.includes(': Ubuntu')) ||
((prerequisite.id === 'dockerDesktop' || prerequisite.id === 'dockerDesktopUbuntu') &&
stdOutput.includes('Server: Docker Desktop'))
Expand Down
12 changes: 12 additions & 0 deletions src/renderer/components/Config/PrereqsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ const PrereqsView = ({ onChange, sx }: Props) => {
.
</Typography>
)
} else if (status.id === 'ps1ExecutionPolicy') {
status.description = (
<Typography fontSize={14}>
<span style={{ fontSize: 14, opacity: 0.6 }}>
Check whether the execution policy is set to allow unsigned PowerShell scripts.{' '}
Abhijay007 marked this conversation as resolved.
Show resolved Hide resolved
</span>
<a style={{ color: 'white' }} target="_blank" href={"https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1"}>
Abhijay007 marked this conversation as resolved.
Show resolved Hide resolved
Learn more
</a>
.
</Typography>
)
}
}

Expand Down