Skip to content

Wrapping up powershell script - #23

Draft
eld120 wants to merge 8 commits into
mainfrom
seya/windows
Draft

Wrapping up powershell script#23
eld120 wants to merge 8 commits into
mainfrom
seya/windows

Conversation

@eld120

@eld120 eld120 commented Sep 26, 2023

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread README.md Outdated
`Set-ExecutionPolicy Bypass`
`./powershell-test.ps1`
On Windows do the following:
- open powershell as administrator set the system's security policy: `Set-ExecutionPolicy RemoteSigned` This allows scripts to be run locally while requiring scripts downloaded from the internet to be digitally signed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if we just combine this with the command below? Just put it on same command.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can make that happen

Comment thread webserver-windows.ps1 Outdated
# Create ssh key pair if it does not exist for a given user
# gets env username : [Environment]::UserName
# gets user's home path: $env:USERPROFILE
$userName = [Environment]::UserName

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you setting a variable here? Could you just do this inline in the conditional?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm setting the variable above the conditional as it's called in the if and else clause (and also the cloud-init yaml file that I'm working on).

I'm also unfamiliar/uncertain of the scope of this variable but I'm hopeful that it will be available from the yaml file anyway.

…no longer requires admin privileges but only sets the execution policy for the current powershell session
…sociated keys along with the current user's username as the key/username to be passed to the multipass instance. I chose a separate key/username because most of us will have used our email/ssh combination when we set up SSH with github - I'd like to keep that separate/unchanged.

Unsure of the scope of my powershell variables -  afaik they are local/limited to the shell session

Currently blocked by the lack of an IPv4 network address for our multipass instance, working on a network config or a command/flag to pass to multipass launch to set up a network extension. Looking up port forwarding via Virtualbox (unsure if this is sufficient)
@HarmonyMorse
HarmonyMorse marked this pull request as ready for review September 28, 2023 22:26
@HarmonyMorse
HarmonyMorse marked this pull request as draft September 28, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants