How do i create a file that will run something in windows powershell

14sirs 0 Reputation points
2023-01-26T09:32:07.65+00:00

I have recently found out that typing "wininit", and running it in powershell blue-screens your computer.

I was wondering if there was a way to run powershell this by opening a file/running a file, so that I could mess with my friends.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,200 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,998 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,332 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 43,331 Reputation points
    2023-01-26T09:42:29.7466667+00:00

    Do you mean a PowerShell script file?

    It's a plain text file, which you can edit them in any text editor. Or more comfortable in tools like Visual Code

    https://code.visualstudio.com/

    0 comments No comments

  2. Limitless Technology 44,126 Reputation points
    2023-02-01T11:07:58.65+00:00

    Hello,

    Initially, I would not recommend playing around with command instructions that can force a BSOD error on the system, as it could lead to corruption of memory, virtual memory allocation, and storage on the target system.

    Besides this, you can convert a PS1 file into EXE with the PS2EXE Powershell module.

    First Install the module with:

    Install-Module ps2exe

    then you can convert your file for distribution with:

    Invoke-ps2exe .\source.ps1 .\target.exe

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments