News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • PowerShell – Useful one-liners (maybe two…)

    Posted on Rick Corbett Comment on the AskWoody Lounge

    Home Forums Developers, developers, developers DevOps Lounge PowerShell – Useful one-liners (maybe two…)

    This topic contains 66 replies, has 10 voices, and was last updated by  Rick Corbett 3 months, 3 weeks ago.

    • Author
      Posts
    • #1852118 Reply

      Rick Corbett
      AskWoody_MVP

      Without going into the ‘why and wherefore’ of each PowerShell command, how about some of the PowerShell ‘one (or two)-liners’ that may be found useful?

      (I have no doubt that others keep the same type of ‘cheat sheets’ that I do. Perhaps share? πŸ™‚

      7 users thanked author for this post.
    • #1852131 Reply

      Rick Corbett
      AskWoody_MVP

      How to get workgroup name:

      (Get-WmiObject -Class Win32_ComputerSystem).Workgroup
      • #1857070 Reply

        RetiredGeek
        AskWoody MVP

        Rick,

        Just something to tuck away in your mind the Get-WmiObject is depreciated and is replaced by the Get-CimInstance command.

        PS>(Get-CimInstance -class Win32_computersystem).workgroup
        HOME
        PS>

        HTH 😎

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

        1 user thanked author for this post.
        • #1857762 Reply

          Rick Corbett
          AskWoody_MVP

          Many thanks, @retiredgeek. I wasn’t aware of this at all. Strange that it doesn’t seem to be well-known either… all I see are WMI queries.

    • #1852148 Reply

      Rick Corbett
      AskWoody_MVP

      Check whether hotfixes installed (example):

      Get-HotFix -Id KB4499164,KB4499175
    • #1852166 Reply

      Rick Corbett
      AskWoody_MVP

      Get local accounts:

      Get-WmiObject -Class Win32_UserAccount -Filter "LocalAccount='True'"
      • #1857088 Reply

        RetiredGeek
        AskWoody MVP

        Instead of fiddling around with quotes you can use the builtin variable $True.

        Get-Ciminstance -class Win32_UserAccount -Filter LocalAccount=$True

        HTH 😎

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

        • This reply was modified 3 months, 3 weeks ago by  RetiredGeek.
        1 user thanked author for this post.
    • #1852241 Reply

      Rick Corbett
      AskWoody_MVP

      Get list of default installed apps:

      Get-ProvisionedAppXPackage -Online | Select DisplayName
    • #1852254 Reply

      Rick Corbett
      AskWoody_MVP

      Get list of installed printer drivers:

      Get-PrinterDriver
    • #1852312 Reply

      Rick Corbett
      AskWoody_MVP

      Empty the Recycle Bin:

      Clear-RecycleBin -Confirm:$false
    • #1852344 Reply

      Rick Corbett
      AskWoody_MVP

      Get sound card info:

      Get-Wmiobject -class "Win32_SoundDevice" | Fl * -Force
    • #1852417 Reply

      Rick Corbett
      AskWoody_MVP

      Get BIOS info:

      Get-Wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" | Fl * -Force
    • #1852530 Reply

      Rick Corbett
      AskWoody_MVP

      Get charging percentage of laptop battery:

      Get-WmiObject Win32_Battery | Select Caption,Name,DesignVoltage,DeviceID,EstimatedChargeRemaining,EstimatedRunTime
    • #1852538 Reply

      Rick Corbett
      AskWoody_MVP

      Get (laptop, not CMOS) battery capacity:

      (Get-WmiObject -Class "BatteryStaticData" -Namespace "ROOT\WMI").DesignedCapacity
    • #1852624 Reply

      Rick Corbett
      AskWoody_MVP

      Get battery charge (laptop, not CMOS):

      (Get-WmiObject -Class "BatteryFullChargedCapacity" -Namespace "ROOT\WMI").FullChargedCapacity
    • #1852667 Reply

      Rick Corbett
      AskWoody_MVP

      Get last boot time:

      Get-CimInstance -ClassName win32_operatingsystem | select  lastbootuptime
      • #1857107 Reply

        RetiredGeek
        AskWoody MVP

        Another way:

        PS>(Get-CimInstance -ClassName win32_operatingsystem).lastbootuptime

        Monday, June 24, 2019 10:59:03 AM

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

    • #1852668 Reply

      Rick Corbett
      AskWoody_MVP

      Get running scheduled tasks:

      Get-Scheduledtask  | where state -eq "Running"
    • #1852687 Reply

      Rick Corbett
      AskWoody_MVP

      Get hard disk model and serial number:

      Get-WmiObject win32_diskdrive | Select Model,SerialNumber
    • #1852696 Reply

      Rick Corbett
      AskWoody_MVP

      List attached disks (inc. health):

      Get-disk
    • #1852702 Reply

      Rick Corbett
      AskWoody_MVP

      List attached USB disks:

      Get-disk |  where { $_.bustype -eq "usb" }
    • #1852740 Reply

      Rick Corbett
      AskWoody_MVP

      Get current IP configuration:

      Get-NetIPConfiguration

      Hmm… it works but there are better queries…

      • #1854232 Reply

        Rick Corbett
        AskWoody_MVP

        Ha! I’ve just found out that both ipconfig and ipconfig /all both work as PowerShell queries (and can be piped to a text file or [currently my favourite] the Windows clipboard).

        Example:

        ipconfig /all | clip

        How cool is that? πŸ™‚

        1 user thanked author for this post.
        • #1854463 Reply

          anonymous

          I just checked, and that also works from the plain ‘ol command line!

          Been playing around and have found out I’ve got version 2, so, from what I’ve seen on the MS pages, it might be a good idea to get upgraded to at least 3, if not 5.1 for Win 7 Pro SP1 x64.

    • #1852756 Reply

      Rick Corbett
      AskWoody_MVP

      Get computername, manufacturer, model, workgroup and total physical RAM:

      Get-WmiObject -Class Win32_ComputerSystem
    • #1852780 Reply

      Rick Corbett
      AskWoody_MVP

      Get list of all network adapters:

      Get-NetAdapter
    • #1852786 Reply

      Rick Corbett
      AskWoody_MVP

      Get IP address:

      Get-NetIPAddress
    • #1852846 Reply

      Rick Corbett
      AskWoody_MVP

      Get computername:

      hostname

      or

      (Get-WmiObject Win32_ComputerSystem).Name

      or

      $env:COMPUTERNAME
    • #1852847 Reply

      Rick Corbett
      AskWoody_MVP

      Restart the device:

      Restart-Computer
    • #1852863 Reply

      Rick Corbett
      AskWoody_MVP

      Get PowerShell version:

      $PSVersionTable
    • #1852864 Reply

      Rick Corbett
      AskWoody_MVP

      Get PS execution policy:

      Get-ExecutionPolicy
    • #1852865 Reply

      Rick Corbett
      AskWoody_MVP

      Get location of temp USER files:

      $env:TEMP
    • #1852866 Reply

      Rick Corbett
      AskWoody_MVP

      List all installed printers:

      Get-WmiObject -Query " SELECT * FROM Win32_Printer" | Select Name, Default, PortName,Location
    • #1852874 Reply

      Rick Corbett
      AskWoody_MVP

      List default printer:

      Get-WmiObject -Query " SELECT * FROM Win32_Printer WHERE Default=$true"
      • #1857108 Reply

        RetiredGeek
        AskWoody MVP

        BTW Get-CimInstance is also faster.

        PS>Measure-Command -Expression {get-ciminstance -class win32_printer -filter Default=$true}

        Days : 0
        Hours : 0
        Minutes : 0
        Seconds : 0
        Milliseconds : 156
        Ticks : 1560909
        TotalDays : 1.80660763888889E-06
        TotalHours : 4.33585833333333E-05
        TotalMinutes : 0.002601515
        TotalSeconds : 0.1560909
        TotalMilliseconds : 156.0909

        PS>Measure-Command -Expression {Get-WmiObject -Query ” SELECT * FROM Win32_Printer WHERE Default=$true”}

        Days : 0
        Hours : 0
        Minutes : 0
        Seconds : 0
        Milliseconds : 192
        Ticks : 1926661
        TotalDays : 2.22993171296296E-06
        TotalHours : 5.35183611111111E-05
        TotalMinutes : 0.00321110166666667
        TotalSeconds : 0.1926661
        TotalMilliseconds : 192.6661

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

        3 users thanked author for this post.
    • #1852900 Reply

      Rick Corbett
      AskWoody_MVP

      Windows Defender – Turn off RealTime scanning (Please use with caution!)

      Set-MpPreference -DisableRealtimeMonitoring $true
      (requires PowerShell run as an administrator)
    • #1852901 Reply

      Rick Corbett
      AskWoody_MVP

      Count running processes:

      Get-process | measure
    • #1852902 Reply

      Rick Corbett
      AskWoody_MVP

      Count services:

      Get-Service | measure
      • This reply was modified 3 months, 3 weeks ago by  PKCano.
    • #1852908 Reply

      Rick Corbett
      AskWoody_MVP

      Count Windows logs:

      Get-Childitem C:\Windows\*.log
    • #1852934 Reply

      Rick Corbett
      AskWoody_MVP

      List the Windows Defender cmdlets:

      Get-Command -Module Defender
    • #1852935 Reply

      Rick Corbett
      AskWoody_MVP

      Get status of Windows Defender:

      Get-MpComputerStatus
    • #1852972 Reply

      Rick Corbett
      AskWoody_MVP

      Get history of detected threats:

      Get-MpThreat
    • #1853876 Reply

      Cybertooth
      AskWoody Lounger

      Rick, which version of PowerShell are these commands for? I tried a sampling of the ones above on my Windows 7 PC using copy-and-paste from your posts, and got errors for Get-disk, Get-NetIPAddress, and Get-MpThreat.

      My version of PowerShell is 3.0. On each of those commands, it returned a series of lines starting with the statement that the term is not recognized.

      The commands that did work, however, were very cool. Let’s have more!Β  πŸ™‚

       

      • #1853918 Reply

        Kirsty
        Da Boss

        Here’s a Microsoft reference for PowerShell cmdlets by PS version, which should assist you.
        PowerShell Module Browser – set to view v3.0, but can be used up to v6.

        That list only goes back to v3.0; to access the v2.0 list, see TechNet here.

        Additionally, you should be able to use “Get-Command” to get a list of cmdlets your version has.

        4 users thanked author for this post.
        • #1854172 Reply

          Rick Corbett
          AskWoody_MVP

          Thank you, @kirsty. Just the sort of helpful response I was hoping for whilst I try to get my head around PowerShell. My main PC is still running Win 7… so I’m often flummoxed why code I spot online doesn’t work for me until I test it on a Win 10 device. This reference will help enormously.

          • #1854553 Reply

            Kirsty
            Da Boss

            There are a number of useful Powershell resources on AskWoody. Check the topic tag (at the top of the topic), and this one has a number of very useful links:
            PowerShell- Learning Virtually on MV Academy & MSDN Channel 9 from Videos, eBook
            (it was a major effort put together by @photm)

            I investigated updating my Win7 Powershell version, but I’ve never had the spare time to go ahead. It couldn’t be updated from the default installed version to 5.0 directly. I did find some useful resources others may find helpful though:
            How to Install Windows PowerShell 4.0 (Technet)
            (Check out the known issues, for example)

            Windows PowerShell Portal (Technet)

            Windows Management Framework (MS Docs)
            This has multiple resources, incl. release notes for v.3 – 5.1, known issues, etc.

            4 users thanked author for this post.
            • #1854683 Reply

              anonymous

              @kirsty

              Good Evening!

              The following link from MS says that you don’t need to uninstall 5.0 to install 5.1, just upgrade by installing directly over your existing installation of 5.0, which is no longer supported at all by MS. BUT, first make sure you’ve got .NET 4.5.2 or greater installed on your machine. I’m currently on PS version 2.0, which was my out-of-the-box version.

              Be sure to read the contents of the blue box at the top of the page directly under the article’s title, AND the notes below the table listing the download links for specific versions of WMF, which PowerShell is a major component of.

              https://docs.microsoft.com/en-gb/powershell/wmf/setup/install-configure

              Hope this helps, when you finally get some time to perform the upgrade to 5.1!

            • #1854765 Reply

              Kirsty
              Da Boss

              Ah… Win7 comes with PS 2.0!

              However, I have now discovered that the prior requirement to install WMF4 before installing WMF5 is no longer necessary (Windows Management Framework the package that includes Powershell, which can’t be installed on its own).

               
              Windows Management Framework (WMF) 5.1 Released
              By PowerShell Team | January 19th, 2017
              Update March 28, 2017

               
              Please note that for Windows 7 and Windows Server 2008 R2 the installation instructions have changed significantly. Please read the Install and Configure topic in the release notes. We have removed the requirement for pre-installing WMF 4 on Windows 7 and Windows Server 2008 R2, but to do so we had create a script for checking the prerequisites that accompanies the MSU in a ZIP file. WMF 5.1 requires .Net version 4.5.2, and cannot be installed on Windows 7 or Windows Server 2008 R2 if WMF 3.0 is installed. This affects only Windows 7 and Windows Server 2008 R2. The Install and Configure topic in the release notes provides details on using the script.

              Read the full article here

              1 user thanked author for this post.
      • #1854171 Reply

        Rick Corbett
        AskWoody_MVP

        Rick, which version of PowerShell are these commands for?

        Good point, well made. I should have included this information for each command. πŸ™‚

        For example, the commands I’ve posted so far are mostly for PowerShell v5 (i.e. included by default in Win 10) as I struggle to become familiar with it.

        Mea culpa… I’ll try to remember to include PS version info with any future posts.

         

        1 user thanked author for this post.
      • #1854268 Reply

        Rick Corbett
        AskWoody_MVP

        @cybertooth – I found out that you can update PowerShell (PS). For example, PS running on my main Windows 7 PC has currently been updated from v3 to v5:

        updated_ps_version_in_win7

        Have a look at this MS Installing Windows PowerShell article.

        Hope this helps…

        Attachments:
        1 user thanked author for this post.
    • #1854192 Reply

      Rick Corbett
      AskWoody_MVP

      I’m just a beginner with PowerShell (PS) (and an ‘improver’ with AskWoody πŸ™‚ ).

      I just thought it would be easier to ask any further questions about an individual one-liner just by clicking on the ‘Quote’ link on each post.

      For example, I’ve realised that some PS one-liners that are native to a particular version of Windows just don’t work with earlier versions of Windows… so WMI queries within PS need to be used instead of just native PS.

      Then there’s the issue about PS itself… I’m finding it hugely powerful… and just as hugely complex to get my head around after being used to the (relative) simplicity of AutoHotkey (AHK).

      For example, back in the days of Windows Secrets Lounge I wrote a tiny program called My WinVer in AHK (Sadly, only the follow-up made the transition here to AskWoody) which @retiredgeek re-wrote in PS. I remarked at the time that the GUI commands in AHK took just a few lines whilst the PS equivalent took many dozens. I just like the comparative simplicity of AHK… PS has come as quite a culture shock and there’s no way that I’m ready to dip my toes in the murky pond of trying to create a GUI using PS.

      Hope this helps…

    • #1854470 Reply

      anonymous

      For those contemplating updating/upgrading their installations of PowerShell from what they currently have to a newer version, please read the system requirements in their entirety, paying special attention to the version of .NET Framework or .NET that is required by the version of PowerShell you’re contemplating installing.

      For example, if the PowerShell version you’d like to install requires version 4.0 or 4.5 of .NET, you may need to install .NET first before installing the version of PowerShell you’ve got your eye on. This may mean installing an older version of .NET than the one you currently have on your system. Some versions of PowerShell require a specific version of .NET, whereas other versions require a specific version or higher of .NET.

      PowerShell 3.0 requires .NET Framework 4.0, whereas PowerShell 5.1 requires .NET framework 4.5 or above.

      Based on the above, my advice to anyone wishing to upgrade to a newer version of PowerShell than what they currently have is to get the version that doesn’t require you to install yet another version of .NET on your system, so one that will work with the version/versions (yep, you can have more than one version of .NET installed at once) of .NET you already have installed on your system.

      2 users thanked author for this post.
    • #1854600 Reply

      NetDef
      AskWoody_MVP

      If you have not yet discovered it, PowerShell ISE is now built-in on every Windows 10 edition (I think . . .)

      It allows you to visually edit your ps1 files, as well as run them, as well as debug.Β  Like a mini-development platform for PowerShell.

      powershellisesamplenetdef

      ~ Group "Weekend" ~

      Attachments:
      2 users thanked author for this post.
      • #1857110 Reply

        RetiredGeek
        AskWoody MVP

        I’d also recommend Visual Studio Code which is free and will do some checking that the PS_ISE doesn’t do.

        I do the vast majority of my PS development in the ISE but use VSCode to do some final checking to clean up my code.

        HTH :cheers:

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

        2 users thanked author for this post.
        • #1857975 Reply

          jayinalaska
          AskWoody Plus

          I’d like to echo RetiredGeek’s endorsement of Visual Studio Code. I do all of my PowerShell and Python coding at work using it. It’s a multi-platform program: runs on Windows, Linux, and MacOS. I use it on both Windows and Linux.

      • #1857877 Reply

        Bob99
        AskWoody Plus

        I’ve got the ISE built-in to my copy of Win7 Pro SP1 x64 with PowerShell 2.0 out-of-the-box! Looks pretty good, but not as good as it does on Win10!! πŸ™‚

        The ISE executable hides in the same locations (yes, locationsΒ for Win 7) that the regular command line executable hides in.

        For Win 7, they’re in Windows\System32\WindowsPowerShell AND in \SysWOW64\WindowsPowerShell, whereas in Windows 10 Enterprise v. 1803 x64, I’ve only found them in the SysWOW64 folder.

        I like the look of the command line and the ISE better in Win10 than what I’ve currently got in Win7.

        Gee, maybe it’s time for me to upgrade my 10 year old Win 7 machines at home to Windows 10??? NOT!!!Β  πŸ™‚Β  πŸ™‚

    • #1857237 Reply

      wavy
      AskWoody Plus

      My PS crashes upon loading and gets the “Controlled folder access blocked” message. Are folks leaving this active or just disabling it.
      IMHO this is one of M$s worst boondogles, why no way to just say yes in perpetuity ? Why do I need to trace down executables, a pain IMH. πŸ™

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
      • #1857269 Reply

        b
        AskWoody Plus

        IMHO this is one of M$s worst boondogles, why no way to just say yes in perpetuity ? Why do I need to trace down executables, a pain IMH. πŸ™

        There is; you don’t:

        Start, Settings, Update & Security, Windows Security, Virus & threat protection, Manage ransomware protection, Allow an app through Controlled folder access, Add an allowed app, Recently blocked apps

        Add an Allowed App through Controlled Folder Access in Windows Defender Security Center

        Knuckle dragger Cannon fodder Chump Daft glutton Idiot Crazy/Ignorant Toxic drinker Blockhead Unwashed mass Seeker/Sucker "Ancient/Obsolete" (Group ASAP) Win10 v.1909

        1 user thanked author for this post.
      • #1857436 Reply

        NetDef
        AskWoody_MVP

        My PS crashes upon loading and gets the “Controlled folder access blocked” message. Are folks leaving this active or just disabling it.
        IMHO this is one of M$s worst boondogles, why no way to just say yes in perpetuity ? Why do I need to trace down executables, a pain IMH. πŸ™

        That’s an optional feature in Windows Defender, (which, btw, now has awesome management abilities on Microsoft 365 for large deployments) but it does require quite a bit of initial config and tweaking, as well as manual updates to the safe list anytime you install something new.

        Enable it, but be willing to manage it.Β  As has always been the case for all White-List approaches to security.

        Personally for small office/home machines I find it more useful to run myself and all other users as Standard Users, restricting my own admin level is much less stressful and almost as good unless I do something silly.

        ~ Group "Weekend" ~

    • #1857284 Reply

      wavy
      AskWoody Plus

      That would be disabling the protection entirely, or having to look up every exception and typing it [an annoyance] !!
      But thanks any way!

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
      • #1857445 Reply

        b
        AskWoody Plus

        That would be disabling the protection entirely,

        It doesn’t.

        or having to look up every exception and typing it [an annoyance]

        You don’t have to type anything in.

        Knuckle dragger Cannon fodder Chump Daft glutton Idiot Crazy/Ignorant Toxic drinker Blockhead Unwashed mass Seeker/Sucker "Ancient/Obsolete" (Group ASAP) Win10 v.1909

    • #1857449 Reply

      wavy
      AskWoody Plus

      That would be disabling the protection entirely,

      It doesn’t.

      or having to look up every exception and typing it [an annoyance]

      You don’t have to type anything in.

      Ok I mis spoke I will still need to hunt up the executable location rather that windows just offering to white list it
      again [painful]

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
      • #1857491 Reply

        b
        AskWoody Plus

        Ok I mis spoke I will still need to hunt up the executable location rather that windows just offering to white list it
        again [painful]

        Are you using version 1803?

        You can’t complain too much about inconvenience if you’re two versions behind current.

        On 1809 or later you don’t need to hunt the executable and Windows does offer it for whitelisting.

        Knuckle dragger Cannon fodder Chump Daft glutton Idiot Crazy/Ignorant Toxic drinker Blockhead Unwashed mass Seeker/Sucker "Ancient/Obsolete" (Group ASAP) Win10 v.1909

        1 user thanked author for this post.
      • #1857901 Reply

        Bob99
        AskWoody Plus

        Ok I mis spoke I will still need to hunt up the executable location rather that windows just offering to white list it
        again [painful]

        We have Windows 10 Enterprise ver.1803 at work, and our PowerShell executables are in the \Windows\SysWOW64\WindowsPowerShell\v1.0 folder. There you should find the command line executable as well as the ISE executable. I highlighted the v1.0 to ensure you didn’t think I’d mistyped v10. The folder name is, indeed, “v1.0”.

        That’s also the same place they hide on my machines at home that have Win 7 x64 SP1. So, I think it’s a fair bet to say that the location mentioned above is where you’ll find them.

        I hope this helps, especially if you decide to get into writing scripts with PowerShell!

        2 users thanked author for this post.
    • #1858017 Reply

      jayinalaska
      AskWoody Plus

      The following comments are based on my experiences with PowerShell v 5.x. I believe they’re valid for v 3.x, but I’m not certain of that.

      PowerShell has what I consider to be a fabulous help system. If you want the latest versions of the help files on your local machine (may not want to do this on a slow and/or metered connection):

      Update-Help -Force

      The main help command is called Get-Help. To see its help article:

      Get-Help Get-Help

      Output from the Get-Help command continuously scrolls to the PowerShell window, so help articles that are larger than one screen always scroll to the end with Get-Help, which isn’t useful.

      Get-Help has two aliases, help and man, that display the help article one page at a time:

      help Get-Help

      Get-Help and its aliases will show you all of the syntax for the command and provide a description. You don’t get any explanation of the parameters nor do you get any examples. To get these, add the “-Detailed” switch:

      help Get-Help -Detailed

      If you just want the examples:

      help Get-Help -Examples

      Looking at the help article in the PowerShell console, especially for really long help articles, can be tedious. The pager is like the *NIX more command: you can only scroll forward. Plus, as you enter other PowerShell commands, the help article gets farther and farther back in the scroll buffer. If there were only some way to pop the help article up in its own window…

      help Get-Help -ShowWindow

      This is generally my goto view for help. With the “-ShowWindow” switch, you get the full text of the help article as if you provided the “-Detailed” switch, too. Also, there’s an entry field to find text in the help article.

      If you’re on a metered connection or just don’t want to use the bandwidth to get local copies of the help files, use the “-Online” switch.

      help Get-Help -Online

      This will open your default browser and take you to the Microsoft TechNet Library page for the help article. A nifty feature about this page is it will default to the help article for the PowerShell version you have installed and you can change to the help article for other versions of PowerShell, if they exist. Note: the “-Online” switch won’t be useful for PowerShell modules/commands you’ve installed from third parties.

      You can use wild cards in the help topic to get back of list of help articles matching the pattern. Let’s say you know there’s some network command you’ve used before, but you can’t quite remember what it is:

      help *network*

      This will give you a listing of all the help articles that have “network” somewhere in the command name.

      Finally, PowerShell has a large number of special “about” help articles. To see what those are:

      help about*

      Hope you find this useful.

      • This reply was modified 3 months, 3 weeks ago by  jayinalaska. Reason: fixed some awkward phrasing
      3 users thanked author for this post.
    • #1858793 Reply

      wavy
      AskWoody Plus

      I gotta say thanks to the power shell help I got. Very good info!

      I am really yammering about the Controlled folder access blocked message
      I should have started a separate topic mea culpa
      Thanks again…

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
      1 user thanked author for this post.

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: PowerShell – Useful one-liners (maybe two…)

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.