Last active
June 6, 2018 13:25
-
-
Save systemcenterblog/1151782ba38d4b558445e0384d58f783 to your computer and use it in GitHub Desktop.
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
#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