Giter Site home page Giter Site logo

sitecorepowershell / console Goto Github PK

View Code? Open in Web Editor NEW
114.0 23.0 69.0 63.59 MB

Sitecore PowerShell Extensions

Home Page: https://doc.sitecorepowershell.com/

License: Other

C# 36.94% Smalltalk 0.58% JavaScript 54.17% CSS 1.34% PowerShell 6.03% HTML 0.80% ASP.NET 0.11% Batchfile 0.01% Dockerfile 0.04%
sitecore sitecore-powershell-extensions spe powershell

console's Introduction

Sitecore PowerShell Extensions

A command line and scripting tool built for the Sitecore platform.

Sitecore PowerShell Extensions


Notice

  • If you are using version 4.2 or older in your environments we recommend you update them to 5.0+ ASAP
  • We recommend that you DO NOT install SPE on Content Delivery servers or run it in setups that face the Internet in an unprotected connections (e.g. outside of a VPN protected environment)
  • Sitecore versions 7.x and below are no longer supported with the release of SPE 5.0

License

The Sitecore PowerShell Extensions module (SPE) provides a robust environment for automating tasks within Sitecore.

Sitecore PowerShell Extensions

Consider some of the following examples to see how SPE can improve your quality of life as a Sitecore developer/administrator:

  • Make changes to a large number of pages:
Get-ChildItem -Path master:\content\home -Recurse | 
    ForEach-Object { $_.Text += "<p>Updated with SPE</p>"  }
  • Find the oldest page on your site:
Get-ChildItem -Path master:\content\home -Recurse | 
    Select-Object -Property Name,Id,"__Updated" | 
    Sort-Object -Property "__Updated"
  • Remove a file from the Data directory:
Get-ChildItem -Path $SitecoreDataFolder\packages -Filter "readme.txt" | Remove-Item
  • Rename items in the Media Library:
Get-ChildItem -Path "master:\media library\Images" | 
    ForEach-Object { Rename-Item -Path $_.ItemPath -NewName ($_.Name + "-old") }

The idea behind the project is to create a scripting environment to work within Sitecore on a granular level to allow you to apply complex modifications and manipulate not just sites, but files and pages on a large scale or perform statistical analysis of your content using a familiar and well documented query language Windows PowerShell.

If you have any questions, comments, or suggegstions with the SPE module, please report them in the Issue Tracker. We'll also gladly respond to any of your questions on Sitecore Shared Source Modules Forum or in the Project Discussion Pages.

Enjoy!

Adam Najmanowicz Michael West
Adam Najmanowicz Michael West
Founder, Architect & Lead Developer Developer & Documentation Lead

Resources

console's People

Contributors

adamnaj avatar alan-null avatar alexkasaku avatar altudopeplau avatar bic742 avatar cogskuzniak avatar dsolovay avatar eptw4by avatar harshbaid avatar iamandycohen avatar jst-cyr avatar krusen avatar markgibbons25 avatar marrrcin avatar michaellwest avatar ozkansayin avatar ptaront avatar robsonautomator avatar rsenk avatar sc-dawidrutkowski avatar scjunkie avatar vgbenjamin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

console's Issues

New-Item should support -Language parameter

I have multi-language environment. I see that New-item command lacks the language parameter. How can I set the language version of the item to be created? -Language parameter would be nice to have.

jQuery must be running in no-conflict mode

When the PowerShell console runs, the browser console shows 2 errors. This is caused by jQuery conflicting with Prototype library used in Sitecore.

Run jQuery in no-conflict mode to prevent it, make sure everything still runs - all modules run in plugin mode.

Add Verbose SwitchParameter support to Write-Log

I was testing out a script today and noticed that using Write-Log will log but not output to the console. This could be useful when writing larger scripts and testing in the ISE.

An alternate approach would be to use -Verbose on Write-Log so that you can toggle it on or off in the ISE.

ISE will no longer show error when executing scripts if user name has dot in the name

ISE saves user settings and last script when they execute. It does so under the following path in master:
/sitecore/system/Modules/PowerShell/Settings/ISE

It creates the settings item for user's domain first and then underneath for your user name.
For default admin it will save your settings in:
/sitecore/system/Modules/PowerShell/Settings/ISE/sitecore/admin

If the user name or domain contained one of those characters that sitecore considers not-kosher for item name the save would fail.

Those characters are now escaped.

private static readonly char[] invalidChars = 
    { '\\', '/', ':', '"', '<', '>', '|', '[', ']', '.' };

_Courtesy of report by Michael West_

Support installation of update packages

Create a commandlet to support importing of .update packages that are used by Sitecore CMS updates, TDS and are created by Courier

_Courtesy of requested and advice by Michael West_

Feature - Cmdlet to run Task Schedule

Something like the Scheduled Task Util project on the market place.

Any name is fine...as long as it doesn't conflict with the PowerShell commands.
Start-TaskScheduler -Name DoSomethingTask

Abort script?

Is there a way to abort running script?
I accidently run some heavy searching script on root instead of a small branch. I needed to reset the app to stop it.
It would be nice to be able to force the script to stop... and nicer if that would trigger some partial result to be showed.

Scripts should be able to call other scripts in the library that are run before the script itself

It's not just experimenting any more - I'm building script libraries with common functionalities and functions, so I want to use those without having to paste them before every script I run.
An example would be a function that formats errors with full stack trace adding "Resolve-Error" function I want to be able to call this function in my scripts so I want my "Resolve-Error" script be run before them so I can make use of them. Kind of like "using" in C#.

I need a way of doing it either from the script or from the script configuration.

New-Item should be able to work with Item given as -Parent rather than paths only

In my environment I have items with the same paths. I workarounded item creation by creating child directly in parent item:

$templateId = New-Object "Sitecore.Data.TemplateID" (New-Object "Sitecore.Data.ID" "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}");
$newItem = $item.Add("test-item", $templateId);

In my case a -Parent and -NewItemName parameters to the New-Item command would be more approprieate as using Path would create Item only under one of my items.

Please note that using parent by newly created item can take it's language version. That would simplify running scripts in multilanguage environment.

Template name that is provided to New-Item should be more flexible

It should accept path that starts with /sitecore/ (when copied from Content Editor) as well as allow for a shorter version when even the /templates/ is skipped for Compatibility with Rocks scripts and convenience.

Generally - remove uncertainty of when the template path will be accepted

PowerShell Console showing %((% in places where [ should be in the results - no more

Result for

PS >get-help install-updatepackage

was showing:

    Install-UpdatePackage %((%%((%-RollbackPackagePath%))% <string>%))% 
        -UpgradeAction <UpgradeAction> {Preview | Upgrade} 
        -InstallMode <InstallMode> {Install | Update}  
        %((%<CommonParameters>%))%

where it should be

    Install-UpdatePackage [[-RollbackPackagePath] <string>]
        -UpgradeAction <UpgradeAction> {Preview | Upgrade} 
        -InstallMode <InstallMode> {Install | Update}  
        [<CommonParameters>]

Initially broken in 2.0

_Courtesy of report by Michael West_

Console Adjustments

Not sure how best to title this. Basically I would like to have the region for the cursor to be increased. Currently you have to click about 1 cm from the prompt PS Master:> before the cursor will be placed there.

Also, would like to have the ESC key clear the entire line, like it does in the Windows PowerShell console.

Get-ChildItem and Get-Item should be able to work with ambiguous paths

I have items with the same path in the system (it is not forbidden and sometime it happens). I've noticed that command get-childitem -recurse returns only only first item of those who have the same path.
I'm trying to use Powershell to repair such items so I would expect commands to return the additonal items in some way.

I'll find the items using object properties so there is no problem with it. But the queestion is: it this a feature of commands to treat the item path as unique? If yes and that will be left for better performance I would be happy if there would be some switch to turn that assumption off for example "-nonUniquePaths" param.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.