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

Discus and support How do i create a file that will run something in windows powershell in Windows 10 Network and Sharing to solve the problem; 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... Discussion in 'Windows 10 Network and Sharing' started by 14sirs, Jan 26, 2023.

  1. 14sirs Win User

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


    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

    :)
     
    14sirs, Jan 26, 2023
    #1
  2. Studynxx Win User

    Powershell / Batch scripts do NOT run!

    Please help me. I have written some powershell and batch scripts, yet when I run those files, they don't run. At most the powershell script just does step #1 but not all the other steps (lines of code / instructions). The batch script .bat file doesn't do anything. Both just pop up for like 2 seconds and then they disappear, Task Manager says nothing's being done.
     
    Studynxx, Jan 26, 2023
    #2
  3. Windows media player is not running

    Dear Sir,

    The following steps suggested to me is not workable to solve my problem. My problem still persists and I am not able to rum windows media player after up gradation of my system to from Windows 7 to Windows 10 !!

    • "Open the Task manager. Here’s a tip: Press CTRL+Shift+ESC.
    • Click File > Run New Task
    • Make sure you have a check mark beside “Create this task with administrative privileges”
    • Type Powershell
    • Type the following in the Powershell prompt:

      $manifest = (Get-AppxPackage Microsoft.WindowsStore).
    • Close the Powershell window
    • Reboot the computer and check if it helps.
    You may also, try to
    create a local user account in Windows 10
    and check if the issue persist."


    Thanks with regard,

    Pradosh Raychaudhuri
     
    PradoshRaychaudhuri, Jan 26, 2023
    #3
  4. ddelo Win User

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

    Export All Administrative Events to Excel

    To analyze events, from the Windows Event Viewer, there is a simple way to export all Administrative Events to Excel, with PowerShell.

    Exporting all Administrative Events to Excel is a simple two Step process, as described here:

    Step 1 - Create the Administrative Events View .xml file
    1. Open Eventviewer (%windir%\system32\eventvwr.msc)
    2. Navigate to: Event Viewer (Local) > Custom Views > Administrative Events
    3. In the “Actions” pane select “Filter Current Custom View”.
    4. Select the the XML tab.
    5. Press Ctrl+A to select all the XML code of the Custom View.
    6. Open a notepad, paste the selected code and save the file to your Desktop as AdmEvtView.xml


    Step 2 - Create the csv file with the events
    1. Download the ExportEvtCSV.zip file, which contains the script ExportEvtCSV.ps1 and unzip it, on your Desktop.
      It's not a fancy script, just basic PowerShell commands to create a csv file on the Desktop.
    2. In Windows Search, type “ISE” (without the quotes) to open “Windows PowerShell ISE” and Run as administrator
    3. To allow running the script, change the ExecutionPolicy, for this session. To do that, in the Console pane type:
      Code:
    4. In the Windows PowerShell ISE, open and run the script: ExportEvtCSV.ps1
      The script will create a csv file with a name YYYYMMDD.HHMM.csv on the Desktop
    5. When done, open the newly created .csv file, format the columns as needed and optionally save it as .xlsx, if you wish.
    That’s it! You now have all the Administrative Events in Excel for filtering and further analysis. How do i create a file that will run something in windows powershell :)

    Now to the more technical hard stuff... *Confused

    There is a reason for running the script from within PowerShell ISE!

    It would be great if everything was also working perfectly, when running the script from an elevated PowerShell too.

    We can run it from an elevated PowerShell, which means that you just follow the Step 1, as above but for the Step 2 instead of the ISE you run the script from an elevated PowerShell.

    The problem is that it will work only for anybody who has en-US format for the dates. Everyone else, who has another format (i.e. en-GB, fr-FR, el-GR etc.), the dates are not translated properly by Excel (although the script uses the –UseCulture switch) and remain as text in the en-US format.

    I'm not sure if this a bug of the "export-csv" cmdlet, but although it runs the way it supposed to from within the ISE, from PowerShell there is a problem with the dates format.
    As I haven’t found a way to overcome this obstacle, any suggestion from the PowerShell gurus of the forum (like my good friend Shawn @Brink, for instance), is welcome.
     
    ddelo, Jan 26, 2023
    #4
Thema:

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

Loading...
  1. How do i create a file that will run something in windows powershell - Similar Threads - create file run

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

    in Windows 10 Gaming
    How do i create a file that will run something in windows powershell: 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...
  3. How do i create a file that will run something in windows powershell

    in Windows 10 Software and Apps
    How do i create a file that will run something in windows powershell: 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...
  4. How do I create a PCK file?

    in Windows 10 Network and Sharing
    How do I create a PCK file?: I would like to create a PCK file to add content to a game, I do not know how to create one. https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-create-a-pck-file/50af210b-c1ba-4308-b568-21b9d6154d11
  5. How do I create a PCK file?

    in Windows 10 Gaming
    How do I create a PCK file?: I would like to create a PCK file to add content to a game, I do not know how to create one. https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-create-a-pck-file/50af210b-c1ba-4308-b568-21b9d6154d11
  6. How do I create a PCK file?

    in Windows 10 Software and Apps
    How do I create a PCK file?: I would like to create a PCK file to add content to a game, I do not know how to create one. https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-create-a-pck-file/50af210b-c1ba-4308-b568-21b9d6154d11
  7. How do i create an iso file of the server 2016 that I am running now for creating a vm of...

    in Windows 10 Gaming
    How do i create an iso file of the server 2016 that I am running now for creating a vm of...: How do i create an iso file of the server 2016 that I am running now for creating a vm of that later? https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-create-an-iso-file-of-the-server-2016/f7c4703f-a421-480c-b397-3c1c8a438a39
  8. How do i create an iso file of the server 2016 that I am running now for creating a vm of...

    in Windows 10 Software and Apps
    How do i create an iso file of the server 2016 that I am running now for creating a vm of...: How do i create an iso file of the server 2016 that I am running now for creating a vm of that later? https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-create-an-iso-file-of-the-server-2016/f7c4703f-a421-480c-b397-3c1c8a438a39
  9. How to create and run PowerShell script file on Windows 10

    in Windows 10 News
    How to create and run PowerShell script file on Windows 10: [ATTACH]A script is just a collection of commands saved into a text file (using the special .ps1 extension) that PowerShell understands and executes in sequence […] This article How to create and run PowerShell script file on Windows 10 first appeared on TheWindowsClub.com....
  10. How to run batch file with powershell

    in Windows 10 Network and Sharing
    How to run batch file with powershell: I created a basic batch file that uses "net share" to share a local path. I saved the batch file. When I double click the file I get "access is denied"... note, I am logged on as a admin. Anyways... I figure it has to be run using power shell. I do not know much about...