Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save systemcenterblog/1151782ba38d4b558445e0384d58f783 to your computer and use it in GitHub Desktop.
Save systemcenterblog/1151782ba38d4b558445e0384d58f783 to your computer and use it in GitHub Desktop.
#Setting the log location
$env:LogPath = "$env:ProgramData\CompanyName\Logs"
#Checking the log path
if((Test-Path $env:logpath) -eq $False)
{
New-Item -path $env:LogPath -type directory
}
#Starting the log file
Start-Transcript -path "$env:LogPath\Diagnostics_Office365.log" -append
#### Processor architecture ####
if ($Env:PROCESSOR_ARCHITECTURE -eq "amd64")
{
echo "$(Get-Date -format T) - 64 Bit Detected"
}
Elseif ($Env:PROCESSOR_ARCHITECTURE -eq "x86")
{
echo "$(Get-Date -format T) 32 Bit Detected"
}
# Running Diagnostics Office 365
echo "$(Get-Date -format T) - Running Diagnostics Office 365"
# Command line MSDT.exe /Cab .\officeact.diagcab /moreoptions false
(start-process <#-wait#> "MSDT.exe" -ArgumentList "/Cab .\officeact.diagcab /moreoptions false" -PassThru).ExitCode
echo "$(Get-Date -format T) - Launched Diagnostics Office 365:"
#Killing the transcript
echo "$(Get-Date -format T) - Deployment Finished"
Stop-Transcript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment