During development, your local environment is getting messy with each new project and Sitecore release.
With the passage of time, we can forget about our Solr, Mongo and Sitecore instances.
With PowerShell, you can quickly list all resources required by Sitecore like Solr, Mongo and xConnect services. The following snippet list your services and displays status, name and path where are they installed:
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 Write-Host "xConnect" -ForegroundColor Green Get-Service *xconnect* (gwmi win32_service|?{$_.name -like "*xconnect*"}).pathname
You can also list your Sitecore instances, with website name and physical path.
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)" } }
During Solr installation two environment variables are important JAVA_HOME and SOLR_HOME. If they are wrong, you can make trouble during Sitecore installation.
[environment]::GetEnvironmentVariable("JAVA_HOME") [environment]::GetEnvironmentVariable("SOLR_HOME")
As you can see you can easily list all Sitecore resources with a few simple PowerShell commands.
Did I miss something? You have some additional resources to check? Or ideas to implement?
Please contribute here or share feedback with @RobsonAutomator.