Windows 10: Run Multiple Commands In Powershell?

Discus and support Run Multiple Commands In Powershell? in Windows 10 Performance & Maintenance to solve the problem; Hi, I have three drives in my PC. Two of them are SSD's and the third one is a mechanical HDD. I like to optimize them using Powershell. However, as... Discussion in 'Windows 10 Performance & Maintenance' started by Geosammy, May 6, 2018.

  1. Geosammy Win User

    Run Multiple Commands In Powershell?


    Hi,

    I have three drives in my PC.
    Two of them are SSD's and the third one is a mechanical HDD.
    I like to optimize them using Powershell.

    However, as it stands now.
    I'm running the commands separately for each of my drive, i.e.

    1.) Optimize-Volume -DriveLetter C -ReTrim -Verbose
    For optimizing the (M.2 NVME) C:\ drive.

    2 .) Optimize-Volume -DriveLetter D -Verbose
    To optimize the (Mechanical HDD) D:\ drive.

    3.)Optimize-Volume -DriveLetter E -ReTrim -Verbose
    For the (SSD 850 EVO) E:\ drive.

    Is there a way to combine these 3 commands into one command.
    Which will run in Powershell.
    Without having to enter/type each of the commands separately?

    Thanks.

    :)
     
    Geosammy, May 6, 2018
    #1
Thema:

Run Multiple Commands In Powershell?

Loading...
  1. Run Multiple Commands In Powershell? - Similar Threads - Run Multiple Commands

  2. Running Multiple Command Prompts and launch screens on Office and Windows

    in Windows 10 Software and Apps
    Running Multiple Command Prompts and launch screens on Office and Windows: When I run command prompt I get three windows. When I run Word I get 2. When I USE Outlook everything on the screen freezes. This has all happened since the last update. Does anyone have a similar problem or better yet, a fix?...
  3. Linux command in Windows PowerShell

    in Windows 10 Customization
    Linux command in Windows PowerShell: When did Windows incorporate Linux command in PowerShell? https://answers.microsoft.com/en-us/windows/forum/all/linux-command-in-windows-powershell/a5a16d50-78a3-4d90-9965-d60d3b550231
  4. Powershell command for installing exe and msi

    in Windows 10 Support
    Powershell command for installing exe and msi: Can someone help me with powershell commands for installing some exe and msi files from a pendrive? I have apps like Cisco Jabber (MSI), Cisco AnyConnect (exe), Dell Command Update (MSI), and Webex Teams(MSI) I need to add to my powershell script to automatically install the...
  5. Powershell command for deleting everything EXCEPT for...

    in Windows 10 Support
    Powershell command for deleting everything EXCEPT for...: Hey guys, just wondered if anyone could help me with this. So basically, I have a directory with a crap ton of subdirectories, each with a crap ton of files in them. The files all have widely varying names (they're all ZIP files so they have the same extension), and I only...
  6. Use "Command Prompt" instead of "PowerShell"

    in Windows 10 Customization
    Use "Command Prompt" instead of "PowerShell": Hi! I'm using Windows 10 version 1807, In this version, the option "Open in Command Prompt" fully removed from Explorer, in "File" menu and [Shift]+[Right Click] menu, And there's no option to get it back in Settings, only there's an option for [Alt]+[X] menu. I have to...
  7. Execute Powershell command on remote computer

    in Windows 10 Network and Sharing
    Execute Powershell command on remote computer: Hello, I would like to execute a PowerShell command on a remote computer. The command is the following: Invoke-Command -ComputerName 10.40.27.174 -ScriptBlock { Get-ChildItem C:\ } -credential User I get the following error: [10.40.27.174] La connexion au serveur...
  8. Can't run command in PowerShell but OK in Cmd

    in Windows 10 Support
    Can't run command in PowerShell but OK in Cmd: [img] [img] The screen shots show results of running Code: "C:\Program Files\AVAST Software\Avast\ashCmd.exe" /@=Quick[/quote] in both PS and Cmd. The problem is I have made a task in Task Scheduler to run this command daily and, apparently, Task Scheduler insists on...
  9. Run Multiple Commands In Powershell?

    in Windows 10 Performance & Maintenance
    Run Multiple Commands In Powershell?: Good job, @lx07. Of course, you had the benefit of knowing the OP wanted to run the same command on 3 targets. Had I been armed with that same information, I might have made that same suggestion, too. That's why we're better working together than working individually. --Ed--
  10. Change PowerShell To Command Prompt

    in Windows 10 Support
    Change PowerShell To Command Prompt: How do you change from PowerShell to Command Prompt using file explorer ? 104838

Users found this page by searching for:

  1. running multiple powershell commands at once

    ,
  2. run multiple powersell commands