This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "SQL" -ForegroundColor Green | |
Get-Service *SQL* | |
Write-Host "SOLR" -ForegroundColor Green | |
Get-Service *solr* | |
(gwmi win32_service|?\{$_.name -like "*solr*"}).pathname | |
Write-Host "Mongo" -ForegroundColor Green | |
Get-Service *mongo* | |
(gwmi win32_service|?{$_.name -like "*mongo*"}).pathname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-WebSite | ForEach-Object { | |
$binPath = Join-Path -Path $_.PhysicalPath -ChildPath "bin\Sitecore.Kernel.dll" | |
$item = Get-Item -Path $binPath -ErrorAction SilentlyContinue | |
if( $item -ne $null ) | |
{ | |
"Sitecore Site: Name:$($_.Name), Version: $($item.VersionInfo.FileVersion), Path $($_.PhysicalPath)" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[environment]::GetEnvironmentVariable("JAVA_HOME") | |
[environment]::GetEnvironmentVariable("SOLR_HOME") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Write-EmbeddedFile | |
{ | |
param | |
( | |
[string]$base64, | |
[string]$targetFile | |
) | |
process | |
{ | |
$Content = [System.Convert]::FromBase64String($base64) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$DotNETCoreUpdatesPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates\.NET Core" | |
$DotNetCoreItems = Get-Item -ErrorAction Stop -Path $DotNETCoreUpdatesPath | |
$NotInstalled = $True | |
$DotNetCoreItems.GetSubKeyNames() | Where { $_ -Match "Microsoft .NET Core.*Windows Server Hosting" } | ForEach-Object { | |
$NotInstalled = $False | |
Write-Host "The host has installed $_" | |
} | |
If ($NotInstalled) { | |
Write-Host "Can not find ASP.NET Core installed on the host" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pass = ConvertTo-SecureString -AsPlainText '123' -Force # 123 - actual password | |
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList 'Martin',$pass # Martin - actual username | |
$Session = New-PSSession -ComputerName 192.168.173.14 -Credential $Cred # IP address of remote machine | |
$remotePath = Invoke-Command -Session $session -ScriptBlock { New-Item -ItemType Directory -Force -Path Sifon } #Get-Location | |
Copy-Item -Path "c:\Some\Path\To\Local\Script.ps1" -Destination $remotePath.FullName -ToSession $session | |
Remove-PSSession $Session |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pass = ConvertTo-SecureString -AsPlainText '123' -Force | |
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList 'Martin',$pass | |
Invoke-Command -ComputerName 192.168.173.14 -ScriptBlock { Get-ChildItem C:\ } -credential $Cred |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
$installFolder = "c:\solr", | |
$solrPort = "8721", | |
$solrHost = "solr", | |
$solrSSL = $true, | |
$downloadFolder = "$PSScriptRoot" | |
) | |
$solrVersion = "7.2.1" | |
$solrName = "solr-$solrVersion" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adds Expand all and Collapse all buttons to Content Editor */ | |
scContentEditor.prototype.onDomReady = function (evt) { | |
this.addCollapser(window.jQuery || window.$sc); | |
}; | |
scContentEditor.prototype.addCollapser = function ($) { | |
$ = $ || window.jQuery || window.$sc; | |
if (!$) { return; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set-ExecutionPolicy "RemoteSigned" -Scope Process -Confirm:$false | |
#Set-ExecutionPolicy "RemoteSigned" -Scope CurrentUser -Confirm:$false | |
Set-ExecutionPolicy Unrestricted | |
Import-Module -Name SPE | |
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://platform.dev.local | |
Invoke-RemoteScript -ScriptBlock { |