Category 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.:
Get-Command

Show infos about powershell command shell:
Get-PSSnapin

Show all alias commands from powershell:
Get-Alias

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
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.
replace_cmd_powershell

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 , , .

Web service and XML with Windows PowerShell .

In this tutorial I show you the basics of poarse XML file and acces website.

Also I show that with the graphical user interface (GUI) using Windows PowerShell

It is very easy to using a Web service in PowerShell V2.

We can use that with the new Cmdlet New-WebServiceProxy.

The PowerShell knows how to handle XML.We just need to cast it to an XML object

Let’s try to get weather from internet.

This is the source code:

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

Now that we see weather infos from London City Airport – United Kingdom.

powershell weather

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