October 22, 2014 at 1:04 am #19942
I need the following powershell script and i cant figure out how to make this.
———— pseudo powershell code ———-
Tjeck for office 2013 installation.
IF Office 2013 is installed, remove Office 2013 and Install/upgrade to Office 366
ELSE run Office 365 Quickrepair with finish dialog "Repair done"
End of script
Can someone help me with this?
October 22, 2014 at 1:52 am #19945
IMHO you should yourself 🙂 This is not cookbook forum 🙂
[ul]To check if app is installed I would use [b]Get-WmiObject -Class Win32_Product[/b][/ul]
[ul]To uninstall app I would get MSI GUID from first command and run [/b][/ul]
[ul]To install app I would use quiet installation method of app [/b][/ul]
Have a look [url=http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/13/use-powershell-to-quickly-find-installed-software.aspx]here[/url] and [url=http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/15/use-powershell-to-find-installed-software.aspx]here[/url].
October 22, 2014 at 2:28 am #19948
Hi, yes i know and i should have wrote, that i am indeed trying.
I am working on a powershell script now, but have run into the first problem.
I want to run a windows troubleshooter file (.diagcab) SILENT, from a powershell script. This file uninstalles ALL office instances on a client.
I manage to read that you have to make a answerfile to make it silent but im stuck here. :o/
October 22, 2014 at 4:20 am #19952
Could you give an example from your script on how you are running the troubleshooting pack?
This is stated in the help file for "Get-TroubleshootingPack":
Example 4: Generate an answer file
Get-TroubleshootingPack -Path "C:\Windows\Diagnostics\System\Audio" -AnswerFile "AudioAnswerFile.xml"
This command uses the Get-TroubleshootingPack cmdlet to generate an answer file. The Areo troubleshooting pack provides
a series of questions for the user to describe the troubleshooting situation and saves that information in the specified XML file.
This is stated in the help file for "Invoke-TroubleshootingPack":
Example 3: Run a troubleshooting pack in unattended mode
$Audio = Get-TroubleshootingPack -Path "C:\Windows\Diagnostics\System\Audio" Invoke-TroubleshootingPack -Pack $Audio -AnswerFile "AudioAnswerFile.xml" -Unattended
This example runs the Audio pack in unattended mode with a specified answer file.
The first command uses the Get-TroubleshootingPack cmdlet to get a DiagPack object and stores it in the $Audio variable.
The second command invokes the troubleshooting pack stored in $Audio in unattended mode. The command specifies an answer
file, previously created by using the Get-TroubleshootingPack cmdlet.
I can't test this on your specific diagcab but you could try to run the first example I showed you and then the second one, with your specific paths of course.
October 23, 2014 at 5:30 am #19995
I managed to do it with your help.
You must be logged in to reply to this topic.