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

Conversation

Abhijay007
Copy link
Contributor

Summary

Added prerequisite on windows for permission to run ps1 scripts

References

closes #63

Checklist

  • If this PR is still a WIP, convert to a draft
  • ensure all checks pass
  • When this PR is ready, mark it as "Ready for review"
  • Changes have been manually QA'd
  • Changes reviewed by at least 1 approved reviewer

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

…ipts

Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
@Abhijay007 Abhijay007 marked this pull request as draft April 28, 2023 17:37
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
@Abhijay007 Abhijay007 marked this pull request as ready for review May 11, 2023 10:34
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
@hanzlamateen
Copy link
Member

hanzlamateen commented May 12, 2023

In create cluster dialog it shows a cross despite my policy being already set to unrestricted.

Here is what I see when I hover over the info icon next to it.

Get-ExecutionPolicy : The 'Get-ExecutionPolicy' command was found in the module 'Microsoft.PowerShell.Security', but
the module could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'.
At line:1 char:1
+ Get-ExecutionPolicy;
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-ExecutionPolicy:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

image
image

@hanzlamateen
Copy link
Member

Same behavior on config page
image

src/renderer/components/Config/PrereqsView.tsx Outdated Show resolved Hide resolved
src/renderer/components/Config/PrereqsView.tsx Outdated Show resolved Hide resolved
src/main/handlers/Utilities/Prerequisites.ts Outdated Show resolved Hide resolved
src/main/handlers/Utilities/Utilities.class.ts Outdated Show resolved Hide resolved
{
// Check if the user agent contains PowerShell version information
window.navigator.userAgent.includes('PowerShell')
? `Run the following command in PowerShell ${window.navigator.userAgent}:`
Copy link
Member

@hanzlamateen hanzlamateen Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change Run the following command in PowerShell:to 'Use PowerShell version_here for following instructions'.

image

<code>Get-ExecutionPolicy</code> - This command will show you the current execution policy.
<br />
<br />
<code>Set-ExecutionPolicy Unrestricted</code> - Use this command to set the execution policy to allow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just keep the script. Remove - Use this command to set the execution policy to allow

running the following commands:
<br />
<br />
<code>Get-ExecutionPolicy</code> - This command will show you the current execution policy.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just keep the script. Remove - This command will show you the current execution policy.

getAppModel(
'ps1ExecutionPolicy',
'PowerShell Execution Policy',
'Get-ExecutionPolicy; $PSVersionTable.PSVersion',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my powershell 7 despite policy being unrestricted I am getting following error

image
image

Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Signed-off-by: Abhijay jain <Abhijay007j@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add prerequisite on windows for permission to run ps1 scripts.
2 participants