Created
July 13, 2021 19:00
-
-
Save SoulOfUniverse/e99bef5051899fd52dad23297cd4f469 to your computer and use it in GitHub Desktop.
Visual Studio Remote Sitecore Powershell Extension
This file contains 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 | |
#> | |
Import-Module -Name SPE | |
$session = New-ScriptSession -Username remoteadmin -Password test -ConnectionUri https://sitecoreinstance.local | |
$jobId = Invoke-RemoteScript -ScriptBlock { | |
Write-Verbose ("Started at " + [System.DateTime]::Now) | |
$files = Get-ChildItem $SitecoreLogFolder | |
$files | sort LastWriteTime | select -last 10 #| Get-Content -Tail 100 | |
Write-Verbose "#### next ####" -ForegroundColor Yellow | |
$files | Where-Object {$_.Name -like "log*"} | sort LastWriteTime | select -last 1 | Get-Content -Tail 200 | |
Write-Verbose ("Finished at " + [System.DateTime]::Now) | |
} -AsJob -Session $session -Verbose | |
Wait-RemoteScriptSession -Session $session -Id $jobId -Delay 1 -Debug -Verbose | |
Stop-ScriptSession -Session $session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment