Installing and using Powershell on Alma Linux is very easy.
How to install Powershell on Alma Linux 9.0
How to install Powershell on Alma Linux 9.0
How to list all WiFI networks with Powershell on Windows.
How to filter text just like with grep easily and filter text with simple tricks.
How to do simple web scraping on Linux and Windows easily. This is very useful.
A few web scraping examples for Powershell. How to get news headlines from a website.
How to use Powershell to get a weather report on the command-line.
A couple of good scripts to get CPU information on Windows 11.
How to print system information with Powershell on Windows 11.
How to get all network interfaces with Powershell on Windows. And how to filter the output of a cmdlet.
How to create a notification window or bubble with Powershell on Windows. This is a very useful scripting tip.
There is a new threat in Microsoft Office, this allows the remote execution of Powershell code on a target computer. This means that you can download an infected office document and then be open to an attack from a script that could do anything to your computer. There is a Proof of Concept file here: … Read more
This simple one-liner for Powershell will print the current uptime of your PC. This is printed with multiple columns but it also may be printed on one line. PS C:\Users\Windows 11> (get-date) – (gcim Win32_OperatingSystem).LastBootUpTime Days : 0 Hours : 0 Minutes : 41 Seconds : 27 Milliseconds : 915 Ticks : 24879150105 … Read more
Showing a pop-up notification from the system tray is very easy with Powershell on Windows 11. To begin, run this command as Administrator to install the BurntToast module. Install-Module -Name BurntToastInstall-Module -Name BurntToast Then you are ready to use this script to show a sample notification. Import-Module BurntToast New-BurntToastNotification -Text "Windows 11 Update", "You are … Read more
This example will get the current IP address(s) of the user`s machine. PS C:\Users\Intel i5> Get-NetIPAddress | Sort-Object -Property InterfaceIndex | where-object -FilterScript {$_.SuffixOrigin -eq "Dhcp"} IPAddress : 192.168.1.114 InterfaceIndex : 10 InterfaceAlias : Ethernet AddressFamily : IPv4 Type : Unicast PrefixLength : 24 PrefixOrigin : Dhcp SuffixOrigin : Dhcp AddressState : Preferred … Read more
Getting good hardware information is very useful on a Windows system, I will show some very useful one-liners for getting hardware information on Windows. This example gives information about the CPU cores and the other pertinent CPU information. PS C:\Users\Intel i5> Get-WmiObject –class Win32_processor | ft systemname,Name,DeviceID,NumberOfCores,NumberOfLogicalProcessors systemname Name DeviceID NumberOfCores NumberOfLogicalProcessors ———- —- … Read more
Getting information about your IP address is easy in Powershell. Below is a simple example, this is printing information about the IP addresses on the system. PS C:\Users\Jim\Pictures\Saved Pictures> Get-NetIPAddress |Select-Object IPAddress IPAddress ——— fec0::6155:1c09:8069:d506%1 fe80::6155:1c09:8069:d506%7 ::1 10.0.2.15 127.0.0.1PS C:\Users\Jim\Pictures\Saved Pictures> Get-NetIPAddress |Select-Object IPAddress IPAddress ——— fec0::6155:1c09:8069:d506%1 fe80::6155:1c09:8069:d506%7 ::1 10.0.2.15 127.0.0.1 This is a … Read more
This is how to get the current IP address of the active network adapter in your Windows system. PS C:\Users\Doom> (Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString 192.168.1.2PS C:\Users\Doom> (Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString 192.168.1.2 This prints the IP address of your machine to the Powershell terminal. This is a great way to get just the IP … Read more
Print the current date and time with Powershell. "{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date)"{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date) This is an example of what this will give you. PS C:\Users\jason> "{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date) Tuesday – 08:42:05 – 30/1/18PS C:\Users\jason> "{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date) Tuesday – … Read more
Installing Powershell for Linux in Ubuntu 16.04 is very easy. I had problems with the packages, but I sorted it out very quickly. Firstly, download the Powershell Debian package. https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.14.04.1_amd64.deb. Then the required libicu package. http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-3ubuntu0.4_amd64.deb. Then install the libicu package. jason$ sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb Selecting previously unselected package libicu52:amd64. (Reading database … 490392 … Read more
This Powershell command will install a Windows feature on your Windows 8.1 or server 2012 machine. I am only using the telnet server as an example. PS C:\Users\Administrator> Install-WindowsFeature telnet-server Success Restart Needed Exit Code Feature Result ——- ————– ——— ————– True No Success {Telnet Server} This is how easy it is to install a … Read more