Tag Archives: powershell

PowerShell tips – part 002.

I will come with new examples and tips with Windows 10 PowerShell.
Let’s start:

List recursive android application from your folder using:
Get-ChildItem -Recurse -Filter “*.apk”

Calculate the number of archives for gmail attachment limit ( max gmail size 25MB):
132MB / 25MB

Lists all of the commands in the current PowerShell session.:

Show infos about powershell command shell:

Show all alias commands from powershell:

Posted in All, Commands, PowerShell, Windows 10. Tagged with , , , , , .

PowerShell tips – part 001.

Some examples and tips with Windows 10 PowerShell. Most of this maybe will working with old versions of Windows but I tested just with Windows 10.

Let’s start:

See the indication of a denial of service (DoS) attack:
netstat -ant | Select-String “SYN_RECEIVED”

Last boot uptime:
(get-date) – (gcim Win32_OperatingSystem).LastBootUpTime

Scan one for threats / malwares (if the scan run then will got one error) :
Start-MpScan -ScanType [QuickScan/FullScan/CustomScan] -ScanPath “C:”

List all drives:
get-psdrive –psprovider filesystem

Make one list of Windows Services and use filter if you want:
Get-Service -Name “Web*”
Get-Service | Out-GridView

Posted in All, Commands, PowerShell, Windows 10. Tagged with , , , , , .

Windows 10 – replace cmd with powershell.

1. Why PowerShell?
– since Windows 7 we have a new command-line environment in Windows named PowerShell;
– is a much more powerful command-line shell;
– the scripting language is more good than the Command Prompt;
– is more complicated than the traditional Command Prompt;
– uses different commands, known as cmdlets in PowerShell;
– allows you to create your own commands and scripts using the C# programming language;
2. How to replace cmd with powershell.
Right click with the mouse on taskbar from bottom of your Windows screen.
Then select the tab named Navigation and select option with: “Replace the …”. Press then Ok button.
Right click with the mouse on the Start icon and will see the replacement of Command Prompt.

Posted in All, Commands, PowerShell, Windows 10, Windows 7, Windows 8. Tagged with , , , , , , .

Windows PowerShell – first setup.

The Windows PowerShell remoting features are supported by the WS-Management protocol and the Windows Remote Management (WinRM) service.

So, Windows PowerShell is a new Windows command-line shell designed for system administrators.

If you got this error show below , than is need to make something.

First , you just need to learn a few tricks for running Windows PowerShell scripts.

You can verify the settings for your execution policy by typing the following at the PowerShell command prompt.
Also you need to set your execution policy to RemoteSigned.

Get-ExecutionPolicy and Set-ExecutionPolicy RemoteSigned

See example below from PowerShell

Now you can use the power of PowerShell.

Let’s the code source of the script. Is a simple script to display BIOS properties.

I hope this tutorial helped you.

Posted in All, PowerShell, Programming, Windows 7. Tagged with , , .

Creating GUIs with Windows PowerShell

In this tutorial I show you the basics of creating a graphical user interface (GUI) using Windows PowerShell

The framework of libraries .NET also referred to as assemblies, are provided specifically for graphical user interface creation, web application development, business process handling and database access, and more…

WinForms is a subset of the .NET framework designed specifically for the creation of Windows based GUIs.

To start Windows PowerShell from the Start menu, click Start, write powershell, and will see something like:

powershell start

The next image shows us the ways to write source code, command line and Windows PowerShell Integrated Scripting Environment (ISE).

powershell tools

Let’s try one example.I will use source from last tutorial about reading BIOS info.

This is the source code:

Run this script with powershell or with Windows PowerShell Integrated Scripting Environment (ISE)

Now that we have seen a simple GUI created in Windows PowerShell.

powershell GUI

Posted in All, PowerShell, Programming, Windows 7. Tagged with , , .