OfficeDev / Office-IT-Pro-Deployment-Scripts

A collection of useful PowerShell scripts to make deploying Office 2016 and Office 365 ProPlus easier for IT Pros and administrators. If you have any feature requests or ideas for future scripts please add the idea to the issues list in this repository
http://officedev.github.io/Office-IT-Pro-Deployment-Scripts
MIT License
887 stars 840 forks source link

Error: You cannot call a method on a null-valued expression. #158

Closed lkleist closed 8 years ago

lkleist commented 8 years ago

I’m getting an error on a test machine that has more than just a single version of Office. Office 2010 is installed along with Project 2010 or Visio 2010 and when the script is executed I get the following error:. You cannot call a method on a null-valued expression. At C:\temp\Generate-ODTConfigurationXML.ps1:1305 char:54

If I uninstall either Project or Visio it works just fine.

AStigall commented 8 years ago

@lkleist we've made some changes to the Generate-ODTConfigurationXML.ps1 script. Can you download the latest version and let us know if it's still an issue?

AStigall commented 8 years ago

@lkleist if this is still an issue for you please let us know and we'll take another look. Thank you for your involvement and letting us know about the issue.

BGleasonGH commented 8 years ago

I am getting this failure as well... Mine was: You cannot call a method on a null-valued expression. At C:\Users\Desktop\Office-ProPlus-Deployment\Deploy-OfficeClickToRun \Generate-ODTConfigurationXML.ps1:1312 char:54

I went as far to see the data in $OfficeVersion and it returned this (mind you all compact)...: @{ComputerName=WIN7X64; InstallPath=C:\Program Files (x86)\Microsoft Office\; ClientCulture=; Bitness=32-Bit; DisplayName=Microsoft Office Professional Plus 2007; ClickToRunUpdateUrl=; Version=12.0.6612.1000; ClickToRunUpdatesEnabled=; ClickToRun=False}

@{ComputerName=WIN7X64; InstallPath=C:\Program Files (x86)\Microsoft Office\; ClientCulture=; Bitness=32-Bit; DisplayName=Microsoft Office Visio Standard 2007; ClickToRunUpdateUrl=; Version=12.0.6425.1000; ClickToRunUpdatesEnabled=; ClickToRun=False}

@{ComputerName=WIN7X64; InstallPath=C:\Program Files (x86)\Microsoft Office\; ClientCulture=; Bitness=32-Bit; DisplayName=Microsoft Office Project Standard 2010; ClickToRunUpdateUrl=; Version=14.0.6029.1000; ClickToRunUpdatesEnabled=; ClickToRun=False}

So looks like get-officeversion is returning too much information/all office apps installed... Just prelim.. This issue should be reopened...

SamSmit commented 8 years ago

We are hitting the same problem with Generate-ODTConfigurationXML. In our case we are seeing it on Office 2010 machines, and one initial finding is that failing machines also have the "Microsoft Office Proofing Tools Kit Compilation 2010" installed.

Our Error: You cannot call a method on a null-valued expression. At C:\O365\Generate-ODTConfigurationXML.ps1:1311 char:54

If I uninstall "Microsoft Office Proofing Tools Kit Compilation 2010" Generate-ODTConfigurationXML runs as expected.

I am actively testing various scenarios including multiple products from multiple versions of office (e.g. Office 2010 Professional + Visio 2013 Standard + Lync 2013) Other than this bug I am optimistic that these scripts will be a huge time saver on our deployment of O365 ProPlus v2016

johnskydiver commented 8 years ago

Closing this ticket since it's referenced in ticket #171. Will continue troubleshooting on that ticket.