Comments (10)
For further analysis, post the complete output of the script running in verbose mode ('-Verbose' parameter), as well as your ini file.
from set-outlooksignatures.
This is the output of the script:
script-output.txt
from set-outlooksignatures.
You set SignatureTemplatePath to '.\templates\Main', but leave SignatureIniPath at the default value of '.\templates\Signatures DOCX_Signatures.ini'. Set SignatureIniPath to '.\templates\Main_Signatures.ini'.
With your settings, the default ini file is used, which only contains references to DOCX templates. This means, the script can't find any matches between the (.htm) files stored in SignatureTemplatePath and the (.docx) files referenced in SignatureIniPath. This, in turn, leads to the error you reported. I wrote a fix in v3.2.1-beta2, which works fine when emulation your situation in my test environment. Please test this version and let me know the result.
You seem to change parameters directly in the script file, instead of passing them as script parameters (such as you did with the '-verbose' parameter). This is totally fine from a technical point of view, but makes version changes harder for you and support harder for both of us. I strongly recommend passing parameters to Set-OutlookSignatures instead of altering them directly in the script file.
Do you have Outlook installed on your test machine? What Outlook version are you using? Either there is a mismatch between registry and the file system, or something is wrong in the version detection. Send me the output of this PowerShell script for verification:
try {
$OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\WOW6432NODE\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction SilentlyContinue).'(default)')\LocalServer32" -ErrorAction SilentlyContinue).'(default)').versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
} catch {
try {
$OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction SilentlyContinue).'(default)')\LocalServer32" -ErrorAction SilentlyContinue).'(default)').versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
} catch {
$OutlookFileVersion = $null
}
}
$OutlookRegistryVersion = [System.Version]::Parse(((((((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CurVer' -ErrorAction SilentlyContinue).'(default)' -ireplace 'Outlook.Application.', '') + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
write-host "Outlook file version: $($OutlookFileVersion)"
write-host "Outlook registry version: $($OutlookRegistryVersion)"
from set-outlooksignatures.
Here is the output from the ps script to get the Outlook version:
PS C:\Users\bhagler> C:\Users\bhagler\Documents\Untitled1.ps1
Outlook file version: 0.0.0.0
Outlook registry version: 16.0.0.0
But I have a new error:
Get all signature template files and categorize them @2022-07-27T08:43:08-07:00@
Unexpected error. Exit.
Cannot index into a null array.
At C:\Users\bhagler\Desktop\Set-OutlookSignatures_v3.2.1-beta2\Set-OutlookSignatures.ps1:1215 char:28
- ... switch ((@($TemplateIniSettings[($TemplateIniSettings.GetEnumerator( ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (:) [], RuntimeException
- FullyQualifiedErrorId : NullArray
from set-outlooksignatures.
That error is a real head-scratcher. It has to do with the way PowerShell treats arrays containing only one element in certain cases.
Rund this development version and post the verbose script output: Set-OutlookSignatures.ps1.txt
Your Outlook installation is very interesting. Whats the registry value of "HKEY_CLASSES_ROOT\Outlook.Application\CLSID(Default)"?
from set-outlooksignatures.
Here is the output from the script you gave me:
script-output.txt
Here are the Registry entries for Outlook:
[HKEY_CLASSES_ROOT\Outlook.Application]
@="Microsoft Outlook Application"
[HKEY_CLASSES_ROOT\Outlook.Application\CLSID]
@="{0006F03A-0000-0000-C000-000000000046}"
[HKEY_CLASSES_ROOT\Outlook.Application\CurVer]
@="Outlook.Application.16"
And:
[HKEY_CLASSES_ROOT\Outlook.Application.16]
@="Microsoft Outlook 16.0 Object Library"
[HKEY_CLASSES_ROOT\Outlook.Application.16\CLSID]
@="{0006F03A-0000-0000-C000-000000000046}"
from set-outlooksignatures.
Ok, I cleared out the credentials and started with a fresh download of v3.2.1-beta1, replaced thSet-OutlookSignatures.ps1 file with the Beta2 and made the change of the template folder and ini folder put in my replacement values (I understand that is not the way to do it, will fix that later).
I ran the script and everything worked, I am giving you a verbose output file:
script-output.txt
from set-outlooksignatures.
Good. Now let's find out what's going on with the detectin of the Outlook file version.
It could be a problem of the Office installation (registry, file system), or a problem in the script. The following PowerShell code will bring us near the reason:
write-host "Get Outlook file version"
try {
write-host " CLSID: $((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID').'(default)')"
write-host " WOW6432NODE"
$OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\WOW6432NODE\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction Stop).'(default)')\LocalServer32" -ErrorAction Stop).'(default)' -ErrorAction Stop).versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
} catch {
write-host " failed: $_"
try {
write-host " Regular node"
$OutlookFileVersion = [System.Version]::Parse((((((Get-ChildItem (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\CLSID\$((Get-ItemProperty 'Registry::HKEY_CLASSES_ROOT\Outlook.Application\CLSID' -ErrorAction Stop).'(default)')\LocalServer32" -ErrorAction Stop).'(default)' -ErrorAction Stop).versioninfo.fileversion + '.0.0.0.0')) -replace '^\.', '' -split '\.')[0..3] -join '.'))
} catch {
write-host " Failed: $_"
$OutlookFileVersion = $null
}
}
write-host " $($OutlookFileVersion)"
from set-outlooksignatures.
The version of Outlook I am using is from Office365:
CLSID: {0006F03A-0000-0000-C000-000000000046}
WOW6432NODE
failed: Cannot find path 'HKEY_CLASSES_ROOT\WOW6432NODE\CLSID{0006F03A-0000-0000-C000-000000000046}\LocalServer32' because it does not exist.
Regular node
16.0.15330.20264
from set-outlooksignatures.
Set-OutlookSignatures can now handly ini files with only one section. The Outlook file version query has been fixed, too. Closing this issue.
from set-outlooksignatures.
Related Issues (20)
- User query LDAP successfully but still get a message about graph and tokens. HOT 4
- Trying to use New outlook but it try to connect to graph when it worked with Old Outlook HOT 2
- V3.6 and Office 2013 : issue with pictures and src value in htm file HOT 2
- v3.6.0 does not find all Outlook mailboxes HOT 5
- Issue reading group membership on local AD HOT 13
- Signatures in Outlook Web (OWA) not working HOT 2
- Wrong version of Word detected HOT 16
- dash is not a valid dash in example script HOT 2
- Mailbox is not member of any allowed group HOT 5
- Can't access local AD HOT 4
- AngleSharp dependency HOT 3
- Getting MSAL token not working on Windows Server 2016 HOT 7
- Outlook Signatures not working in OWA HOT 7
- HTML template variables replacement not working HOT 4
- Get-Process : Es kann kein Prozess mit der Prozess-ID 2716 gefunden werden. HOT 7
- Word not installed or not working correctly. Exit. HOT 3
- Conversion to Base64 is slow, slowing embedding images and loading Graph config file HOT 1
- Script is getting "Currently logged-in user" wrong? HOT 3
- Possible issue with NewOutlook HOT 5
- Signature not being set for new messages or replies/forwards, and is not displayed under Email Account in Signatures and Stationery HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from set-outlooksignatures.