MGS-TECH
asked on
Registry Subkey Count In Powershell
What is the correct syntax for getting a registry subkey count in Powershell, and if that count passes the If statement, then continue.
I am testing this to see if an Outlook profile has not been setup on this computer than continue, otherwise end script
Here is what I have so far:
Get-ChildItem "hkcu:\Software\Microsoft\ Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
[string]$regKeys = Get-ChildItem "hkcu:\Software\Microsoft\ Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
If ($regKeys._GetSubKeyCount -lt 5)
{
'Outlook is setup on this computer'
}
Else
{
'Outlook is not setup on this Computer'
}
I don't believe that I have the ._GetSubKeyCount syntax correct. Please advise.
I am testing this to see if an Outlook profile has not been setup on this computer than continue, otherwise end script
Here is what I have so far:
Get-ChildItem "hkcu:\Software\Microsoft\
[string]$regKeys = Get-ChildItem "hkcu:\Software\Microsoft\
If ($regKeys._GetSubKeyCount -lt 5)
{
'Outlook is setup on this computer'
}
Else
{
'Outlook is not setup on this Computer'
}
I don't believe that I have the ._GetSubKeyCount syntax correct. Please advise.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.