Tag Archives: powershell

PowerShell tips – part 005.

This is another tutorial about PowerShell tips and one powershell command: Get-WindowsOptionalFeature .
Start by using the windows key and try to find the powershell by typing : powershell.
When you see it use right-click the Windows PowerShell and select Run As Administrator from the action menu.
This will open the PowerShell command shell.
Use this command to see all information about the status of the optional Windows features: enabled, disabled, or otherwise:

To have a better view you can use this options:

The where state -eq enabled will show us all features are enabled.
The last part us ft is an alias for Format-Table and –a is the partial parameter for autosize .
You can use PowerShell_ISE to start powershell editor , save the new file named: OptionalFeatures.ps1 .
Into this file you can add the command :

The last part is to run like Administrator this powershell script:

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

PowerShell tips – part 004.

Another tutorial about powershell commands.
Get infos from Enviroment with powershell:
[Environment]::UserName
[Environment]::UserDomainName
[Environment]::MachineName

Test connection to server or test the network connectivity of a computer and get some common properties:
Test-Connection google.com

Test-Connection -ComputerName localhost -Count 1 |
Select-Object IPv4Address,ResponseTime,TimeToLive

Displays diagnostic information for a connection.
Test-NetConnection

Get a detailed IP configuration report for the current machine
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Select-Object -Property [a-z]* -ExcludeProperty IPX*,WINS*

Restart oone service, like DHCP
Restart-Service DHCP

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

PowerShell tips – part 003.

Today I will show you new tips and tricks with powershell.

If you want to see more about your operating system information:
Get-CimInstance Win32_OperatingSystem | FL *

Show your Video Driver version:
gwmi win32_VideoController | select DeviceID,Name,DriverVersion | FT *

Take infos about your laptop battery:
gwmi win32_battery
gwmi -Class batterystatus -Namespace root\wmi

You can retrieve performance information about the current Windows PowerShell process:
Get-Process -Id $pid

Resize your command prompt window:
mode 90,30

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

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