Random Thread - Anything Goes
-
@EddieJennings said in Random Thread - Anything Goes:
My whiteboard
If that's actually a whiteboard, then it's very remarkable.
-
@wirestyle22 Ha!
-
-
-
Why can't I have
free -h
in Powershell? -
@EddieJennings said in Random Thread - Anything Goes:
Why can't I have
free -h
in Powershell?You can. Works fine for me.
-
Free with PS...
PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS /srv/salt> free -h total used free shared buff/cache available Mem: 7.1G 3.6G 820M 511M 2.6G 2.6G Swap: 7.2G 264K 7.2G
-
Alas, not for me. This is a remote PS session into my new hypervisor.
-
@EddieJennings said in Random Thread - Anything Goes:
Alas, not for me. This is a remote PS session into my new hypervisor.
Did you by chance load the hyper-v module into powershell?
-
@scottalanmiller said in Random Thread - Anything Goes:
Free with PS...
PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS /srv/salt> free -h total used free shared buff/cache available Mem: 7.1G 3.6G 820M 511M 2.6G 2.6G Swap: 7.2G 264K 7.2G
This looks like it is running in PowerShell on Linux.
-
Slack conversation. [provided by me for context]
Channel #it-help
UserA [about 1 minute after UserB submitted a ticket]: @eddie UserB [who is currently logged into Slack] is having problems with her workstation phone.
Me: @UserA I responded to UserB's ticket
UserA: Thanks0.o
-
@NerdyDad Other than whatever comes by default, the only module I've imported was the one for Windows updates (which I need to do again, so it persists).
-
@dafyre said in Random Thread - Anything Goes:
@scottalanmiller said in Random Thread - Anything Goes:
Free with PS...
PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS /srv/salt> free -h total used free shared buff/cache available Mem: 7.1G 3.6G 820M 511M 2.6G 2.6G Swap: 7.2G 264K 7.2G
This looks like it is running in PowerShell on Linux.
Yeah. He didn't say anything about windows, only PowerShell. And PS launches the free utility just great.
-
@scottalanmiller Always associated PowerShell as the CLI for Windows. I ought to have been more specific.
-
@EddieJennings said in Random Thread - Anything Goes:
@scottalanmiller Always associated PowerShell as the CLI for Windows. I ought to have been more specific.
It's also that you said why doesn't PS have free, not why doesn't Windows have free. Free is an application, not part of any shell. It's not part of BASH or PS, it's just an application that either can call equally.
-
If free was installed on Windows, PowerShell would have it the same as BASH or ZSH or whatever do on Linux. If you push BASH on Windows, it would lack the free command as well.
-
Try this...
systeminfo |find "Available Physical Memory"
-
@scottalanmiller said in Random Thread - Anything Goes:
Try this...
systeminfo |find "Available Physical Memory"
findstr /c:"stuff"
-
A vendor made it all the way down to us to meet with our managers because he used the buzzword "cyber security" and cityhall thought we should listen to what he had to say. He was a shitty salesguy that couldn't answer basic questions.
-
Straight PowerShell there if you're interested. Probably another 10k easier ways to do it, but this works.
#Free $freemem=get-wmiobject -class Win32_OperatingSystem $objFree=[pscustomobject]@{ totalMemory="$([math]::round($freemem.TotalVisibleMemorySize/1024,2)) MB" usedMemory = "$([math]::round(($freemem.TotalVisibleMemorySize - $freemem.FreePhysicalMemory)/1024,2)) MB" freeMemory="$([math]::round($freemem.FreePhysicalMemory/1024,2)) MB" #freeVirtMem ="$([math]::round($freemem.freevirtualmemory/1024,2)) MB" totalSwap = "$([math]::round($freemem.SizeStoredInPagingFiles/1024,2)) MB" usedSwap = "$([math]::round(($freemem.SizeStoredInPagingFiles - $freemem.FreeSpaceInPagingFiles)/1024,2)) MB" freeSwap = "$([math]::round($freemem.FreeSpaceInPagingFiles/1024,2)) MB" } $objFree|ft -auto
Outputs a table like so:
totalMemory usedMemory freeMemory totalSwap usedSwap freeSwap ----------- ---------- ---------- --------- -------- -------- 20477.57 MB 19544.93 MB 932.63 MB 7450.47 MB 2237.02 MB 5213.45 MB