This Tutorial will allow you to create a custom script that you can execute from the browser URL.

power-shell-extension-url

What do you need in order to perform this tutorial

SiteCore PowerShell Extension

Download and Install SiteCore PowerShell Extension. Access it from the SiteCore Desktop.

power-shell-extension

Add a small custom Script:

script

This script will give you last 20 lines of the log file. Or you can specify a different log file name and different length of lines. Commands are below

if($length -eq $null){
$length = 30
}

if($logType -eq $null){
$logType = “log”
}

Get-ChildItem “$($SitecoreLogFolder)\$LogType*.*” |
Sort-Object -Descending LastWriteTime |
Select-Object -First 1 |
Get-Content -Tail $length

In order for this to work. You need to enable restfulv2 in your Cognifide.PowerShell.config. which is located in Website\App_config\Include\Cognifide.PowerShell.config

<restfulv2 enabled=”true” requireSecureConnection=”false“>

Commands that you can run from the browser while logged in are the following:

Hopefully this helps.

If you have any questions ask me on tmamedbekov or comment below.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s