-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New-AsBuiltReport : Exception calling "Save" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character." #26
Comments
I saw that you ran the script with verbose enabled, can you send me the complete log? if it is not possible maybe you can search if there is any other error message in the log |
Jonathan below is the output. I did look it over before opening this bug report. I am able to get this to work fine on the 2016 & 2019 servers in the customers environment, however 2012 & 2012R2 all give me this error. Additionally, I am getting the error when running the Active Directory module as well. VERBOSE: Saving As Built Report configuration file 'AsBuiltReport.json' to path 'C:\Reports\Config'.
|
Hi Tony, Thanks for the log. I believe the error is on the $global:VerbosePreference = 'Continue'
$global:DebugPreference = 'Continue'
Start-Transcript -Path .\Output.log
New-AsBuiltReport <-- your command here
Stop-Transcript Remember to set its value to the default one after generating the log! $global:VerbosePreference = 'SilentlyContinue'
$global:DebugPreference = 'SilentlyContinue' The output.log can be attached here or if privacy is a concern you can send it to me at: jcolonf@zenprsolutions.com |
Looking into the log the script is failing at the Out-WordDocument cmdlet. Can you re-run the report with the -Format HTML so I can rule out if the problem is just in the Word document format generation? VERBOSE: [ 13:34:55:586 ] [ Word ] - Processing document part '/word/document.xml'.
VERBOSE: [ 13:34:55:601 ] [ Word ] - Writing document part '/word/document.xml'.
PS C:\Windows\system32> TerminatingError(Out-WordDocument): "Exception calling "Save" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character.""
>> TerminatingError(Out-WordDocument): "Exception calling "Save" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character."" Also can you share with us the I did a test with a 2012 r2 server on my HomeLab and was able to generate the report with no problem. I suspect it may be a problem with the character encoding. I have had strange problems with that when using languages or encoding other than En-US. |
….', hexadecimal value 0x00, is an invalid character." AsBuiltReport#26
….', hexadecimal value 0x00, is an invalid character." AsBuiltReport#26
Hi: I found the issue, it was difficult to diagnose but easy to fix.... if you want to test the solution before the next version is released just change the following line: File Src/Private/Get-AbrWinHostStorageVolume.ps1 at line 30: # From:
$HostVolumes = Invoke-Command -Session $TempPssSession -ScriptBlock { Get-Volume | Where-Object {$_.DriveType -ne "CD-ROM" -and $NUll -ne $_.DriveLetter} }
# To:
$HostVolumes = Invoke-Command -Session $TempPssSession -ScriptBlock { Get-Volume | Where-Object {$_.DriveType -ne "CD-ROM" -and $_.DriveLetter} } After saving the changes to the files don't forget to import the module:
|
After some time researching this issue I am unable to identify where the problem lies. At first I thought that the problem was related to the Pscribo module but now I am convinced that it is a problem with the powershell version of windows 2012/2012R2. |
I will leave the issue open so that other users with the same problem can identify that the issue is not fixable. |
I have encountered this issue, and in this instance, the above is indeed the fix. |
The problem is that I don't own the PScribo code and I can't find a way to reproduce the error that will allow me to create an issue in the PScribo repository. If you have a way to reproduce the error and explain it well, would it be possible for you to create an issue in the PScribo repository? Thanks. |
Bug description
When running the report against a 2012R2 server I am receiving this error upon completion. New-AsBuiltReport : Exception calling "Save" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character." The Word file is created however it is zero bytes. I have been able to successfully run it on the same machine against another target (albiet 2016) and it works flawlessly.
Command-line input
New-AsBuiltReport -Report Microsoft.Windows -Target '2012.domain.com' -Format Word -OutputFolderPath 'C:\Reports\Report' -ReportConfigFilePath 'C:\Reports\Config\Microsoft.Windows.json' -Verbose -Filename '2024-04-03 - Windows As Built'
Steps to reproduce
Expected behaviour
Word file creation
Screenshots
No response
Operating System
Server 2019
PowerShell Version
PS C:\Windows\system32> $PSVersionTable
Name Value
PSVersion 5.1.17763.5576
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.5576
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PowerShell Modules
Name Version
AsBuiltReport.Core 1.4.0
AsBuiltReport.Microsoft.Windows 0.5.3
PScribo 0.10.0
Additional Context
No response
Before submitting
The text was updated successfully, but these errors were encountered: