Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.ps1 doesn't have an unblock option and the powershell code won't do anything #12

Open
kosmosterrl opened this issue Aug 23, 2023 · 5 comments

Comments

@kosmosterrl
Copy link

I don't know if this is a windows 11 problem or something but the .ps1 properties doesn't have an unblock option and whenever I put in the powershell code it does nothing.
Screenshot 2023-08-23 142342
Screenshot 2023-08-23 142456

@z80andrew
Copy link

I had the same problem on Win10. Rather than set an execution policy, I unblocked the specific file.

In Visual Studio Code:
Terminal -> New Terminal (Opens a PowerShell prompt at the current project location)

Run Unblock-File '.\Build and Run (Simulator).ps1'

@Panegyr
Copy link

Panegyr commented Dec 30, 2023

I had the same problem on Win10. Rather than set an execution policy, I unblocked the specific file.

In Visual Studio Code: Terminal -> New Terminal (Opens a PowerShell prompt at the current project location)

Run Unblock-File '.\Build and Run (Simulator).ps1'

This should be the recommended method in the readme for allowing vscode to execute the script, changing the entire execution policy for one script is quite excessive and could lead to being exploited by malware

@Whitebrim
Copy link
Owner

I had the same problem on Win10. Rather than set an execution policy, I unblocked the specific file.

In Visual Studio Code: Terminal -> New Terminal (Opens a PowerShell prompt at the current project location)

Run Unblock-File '.\Build and Run (Simulator).ps1'

This should be the recommended method in the readme for allowing vscode to execute the script, changing the entire execution policy for one script is quite excessive and could lead to being exploited by malware

As far as I know unblocking .ps1 file is not the same as running it with admin rights. Both should be done to run it successfully. In the readme there is a code that lets this script be executed without need to launch VS Code as admin (recommend via pull request).
There's a nasty bug in VS Code if it's launched with admin rights: microsoft/vscode#91613

@Panegyr
Copy link

Panegyr commented Dec 30, 2023

I had the same problem on Win10. Rather than set an execution policy, I unblocked the specific file.
In Visual Studio Code: Terminal -> New Terminal (Opens a PowerShell prompt at the current project location)
Run Unblock-File '.\Build and Run (Simulator).ps1'

This should be the recommended method in the readme for allowing vscode to execute the script, changing the entire execution policy for one script is quite excessive and could lead to being exploited by malware

As far as I know unblocking .ps1 file is not the same as running it with admin rights. Both should be done to run it successfully. In the readme there is a code that lets this script be executed without need to launch VS Code as admin (recommend via pull request). There's a nasty bug in VS Code if it's launched with admin rights: microsoft/vscode#91613

Yes this is correct actually, I spoke too soon, RemoteSigned should be safe enough as it's the default setting for Windows Server Installations

@Panegyr
Copy link

Panegyr commented Dec 30, 2023

As for OP, the greyed out Read Only / Hidden / System properties is very odd.

Upon further inspection it looks like they're examining the file as it exists in the ZIP archive, and it hasn't been extracted, indicated by the Method and CRC32 values, it looks like they may have simply confused the default icon for a zip file in windows with that of an actual folder and tried to run the shell script inside of it, which wouldn't work at all afaik

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

No branches or pull requests

4 participants