Skip to content

Instantly share code, notes, and snippets.

@AdamNaj
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamNaj/f37bd5c714992b976cb9 to your computer and use it in GitHub Desktop.
Save AdamNaj/f37bd5c714992b976cb9 to your computer and use it in GitHub Desktop.
-WhatIf
$item = get-item master:\content\Home\
$device = Get-LayoutDevice -Default
$layout = Get-Item "master:\layout\Layouts\Sample Layout"
$contentDataSource = get-item master:\content\home
$rendering = New-Rendering -Path "master:\layout\Renderings\Sample\Sample Rendering"
$renderingItem = Get-Item -Path "master:\layout\Renderings\Sample\Sample Rendering"
$blog = gi "master:/content/Home/blog";
$state = $blog | %{ $_."__Workflow state" }
New-ItemWorkflowEvent -Item $blog -Text "sdfasfd asdf sad fas" -OldState $state -NewState $state -WhatIf
Invoke-Workflow -Path "master:/content/Home/blog" -CommandName "Submit" -WhatIf
Get-UpdatePackageDiff -SourcePath C:\temp\SerializationSource -TargetPath C:\temp\SerializationTarget | Export-UpdatePackage -Path C:\temp\updatepackage -WhatIf
Install-UpdatePackage -Path C:\temp\updatepackage -WhatIf -UpgradeAction Preview -InstallMode Install
Import-Function -Name Resolve-Error -WhatIf
Invoke-Script -Path "master:\system\Modules\PowerShell\Script Library\Copy Renderings\Content Editor\Context Menu\Layout\Copy Renderings" -WhatIf
Restart-Application -WhatIf
Export-Item -Item $item -Whatif
Export-Item -Item $item -Root "$tempPath" -Whatif
Export-Role -Identity "sitecore\Author" -WhatIf
Export-Role -Identity "sitecore\Author" -Root "$tempPath" -WhatIf
Export-User -Identity "sitecore\admin" -WhatIf
Export-User -Identity "sitecore\admin" -Root "$tempPath" -WhatIf
Import-Item -Item $item -Whatif
Import-Item -Database (Get-Database "master") -Root "$tempPath" -Whatif
Import-Role -Identity "sitecore\Author" -WhatIf
Import-Role -Identity "sitecore\Author" -Root "$tempPath" -WhatIf
Import-User -Identity "sitecore\admin" -WhatIf
Import-User -Identity "sitecore\admin" -Root "$tempPath" -WhatIf
New-User -Identity "sitecore\asd" -WhatIf
New-Item -Path master:\content\home -ItemType "Common/Folder" -Name Test -WhatIf
ConvertFrom-ItemClone -Path master:\content\home\blog\404 -WhatIf
Expand-Token -Path master:\content\home\blog\404 -WhatIf
New-ItemClone -Path master:\content\home -Destination (gi master:\content\home\blog) -Name Test -WhatIf
New-ItemClone -Path master:\content\home -Destination (gi master:\content\home\blog) -WhatIf
New-ItemClone -Path master:\content\home -Destination (gi master:\content\home\blog) -Recursive -WhatIf
Publish-Item -Path master:\content\home\blog\404 -WhatIf -Recurse
Publish-Item -Path master:\content\home\blog\404 -WhatIf
Add-ItemLanguage -Path master:\content\home -TargetLanguage "pl" -WhatIf
Add-ItemLanguage -Path master:\content\home -TargetLanguage "pl" -WhatIf -Recurse
Remove-ItemLanguage -Path master:\content\home\blog\404 -Language "pl-pl" -WhatIf
Remove-ItemLanguage -Path master:\content\home\blog\404 -Language "pl-pl", "en" -WhatIf
Remove-ItemLanguage -Path master:\content\home\blog\404 -Language "pl-pl", "en" -ExcludeLanguage "pl-pl", "en" -WhatIf
Remove-ItemLanguage -Path master:\content\home\blog\404 -Language "pl-pl" -WhatIf -Recurse
Install-Package -Path "c:\temp" -whatIf
$package = New-Package -Name "Test Package"
Export-Package $package -Path "Test Package" -WhatIf
Export-Package $package -Path "Test Package" -Zip -WhatIf
Add-Rendering -Item $item -Device $device -Rendering $rendering -Placeholder main -Parameter @{FieldName ="Title"} -DataSource $contentDataSource -whatif
Remove-Rendering -Item $item -Device $device -Rendering $renderingItem -WhatIf
Set-Layout -Item $item -Device $device -Layout $layout -WhatIf
Set-Rendering -Item $item -Instance $rendering -WhatIf
Start-TaskSchedule -Path "master:\system\Tasks\Schedules\Content Testing\Calculate Statistical Relevancy" -whatif
Add-RoleMember -Identity "sitecore\Analytics Advanced Testing" -Members "sitecore\admin", "sitecore\Author" -WhatIf
Disable-User -Identity "extranet\Anonymous" -WhatIf
Enable-User -Identity "extranet\Anonymous" -WhatIf
Lock-Item $item -WhatIf
Unlock-Item $item -WhatIf
Protect-Item $item -WhatIf
Unprotect-Item $item -WhatIf
New-Domain "testdomain" -WhatIf
Remove-Domain "sitecore" -WhatIf
Remove-RoleMember -Identity "sitecore\Analytics Advanced Testing" -Members "sitecore\admin", "sitecore\Author" -WhatIf
Remove-Session -Instance (Get-Session) -WhatIf
Remove-User "sitecore\admin" -WhatIf
Set-User -Identity "sitecore\admin" -WhatIf
Set-UserPassword -Identity "sitecore\admin" -OldPassword "b" -NewPassword "b" -WhatIf
Unlock-User -Identity "sitecore\admin" -WhatIf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment