PowerShell – Part 1

Full Resource: https://technet.microsoft.com/en-us/library/ms714469(v=vs.85).aspx

PowerShell says “execution of scripts is disabled on this system.”

How to run a PowerShell script?

Calling a specific PowerShell function from the command line

How to call a function in another PowerShell script when executing PowerShell script using ‘Run With PowerShell’

To include scripts in the context in ISE, you should first add it into context. You can simply do that by opening the file you want to include via ISE and click on run button. This will add this file into context and you can go ahead and use these functions from other files.

To find which version of Windows you are running, enter the following commands in the Command Prompt or Powershell:

PowerShell – Backup SQL Server System Databases

PowerShell – Backup SQL Server System Databases

this is just and image and you cannot c/p the code. Please visit the source for full article.

Creating new IIS website with Powershell

Nano Server Powershell support

Azure CDN, purging cache

Purge-AzureCdnEnapointContent -EndpointName {@endpointName} -ProfileName {@profileName} -ResourceGroupName {@resourceGroupName} -PurgeContenta @(“/samplefolder/panda.jpg”)

How to get IIS AppPool Worker Process ID

also try

Determine installed PowerShell version

Using the Move-Item Cmdlet

Get processes with Window Title

Get-alias dir

Pipe and sort

Get-winevent and where statement

Get-Member will list possible output properties.

Format-Table will help us to customize output

Get-service sort, where, format-table example

Get-help -showWndow

Help command

 

Help get-service -full

Help get-process online

format-list

show-command

 

Get-wmiobject

Gets instances of WMI classes or information about the available classes. The Get-WmiObject cmdlet gets instances of Windows Management Instrumentation (WMI) classes or information about the available WMI classes.

$profile

Get-PSDrive

Certificate

(Get-WmiObject Win32_ComputerSystem).Name
(Get-WmiObject Win32_ComputerSystem).Domain
(Get-WmiObject Win32_ComputerSystem) | Get-Member

start and stop App Pool

Arp

Displays and modifies entries in the Address Resolution Protocol (ARP) cache, which contains one or more tables that are used to store IP addresses and their resolved Ethernet or Token Ring physical addresses.

Get-ChildItem | sort -Descending lastwritetime | Select-Object -First 5

When you create a function, PowerShell stores it in memory for the duration of your session. During that session, you can call the function at any time by simply entering the function’s name, as in

How to get the current directory of the cmdlet being executed

How do I pass multiple parameters into a function in PowerShell?

How to run a PowerShell script?
http://stackoverflow.com/questions/2035193/how-to-run-a-powershell-script

If you are executing that line from PowerShell rather than from CMD, you can use the PowerShell environment variable syntax: