Powershell

Notes about Powershell

Import-Module WebAdministration -ErrorVariable ImportError -OutVariable ImportOut
if (![string]::IsNullOrEmpty($ImportError))
{
#[void]$Logging.AppendLine(“Import-Module err : ” + $ImportError)
throw ($ImportError)
}
Get-Website

– The problem is that I need elevated rights to use Get-Website

Or maybe just to Import-Module WebAdministration

 


Main – function

http://stackoverflow.com/questions/21000989/how-can-i-create-a-powershell-main-function

Scripts are read from the top to the bottom, so you can’t use any references before they are initiated. You could however create a script/scriptblock that simulates how programming languages work.

 

 

Leave a comment