Skip to content

Instantly share code, notes, and snippets.

@curi0usJack
Last active April 1, 2022 13:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save curi0usJack/2878be90d0f2f45d728b8e8f22bb56fd to your computer and use it in GitHub Desktop.
Save curi0usJack/2878be90d0f2f45d728b8e8f22bb56fd to your computer and use it in GitHub Desktop.
luckystrike debug info
$Excel01 = New-Object -ComObject "Excel.Application"
$ExcelVersion = $Excel01.Version
$Excel01.DisplayAlerts = $false
$Excel01.Visible = $false
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
$OutlookKey = "HKLM:\SOFTWARE\Microsoft\Office\$ExcelVersion\Outlook"
$OutlookWow6432NodeKey = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Office\$ExcelVersion\Outlook"
if(Test-Path $OutlookKey)
{
$officeRegKey = $OutlookKey
}
else
{
$officeRegKey = $OutlookWow6432NodeKey
}
$BitNess = (Get-ItemProperty $officeRegKey).BitNess
$winbit = (gwmi win32_operatingsystem).osarchitecture
$winver = [System.Environment]::OSVersion.Version
[string]::format("{0}.{1}.{2}.{3}", $winver.Major, $winver.Minor, $winver.Build, $winver.Revision) | out-null
$psver = ($PSVersionTable).PSVersion
Write-Output "POWERSHELL VERSION:`t$psver"
Write-Output "EXCEL VERSION:`t`t$ExcelVersion"
Write-Output "OFFICE BITNESS:`t`t$BitNess"
Write-Output "OFFICE REGKEY:`t`t$officeRegKey"
Write-Output "WINDOWS VERSION:`t$winver"
Write-Output "WINDOWS BITNESS:`t$winbit"
Write-Output "ISADMIN:`t`t$IsAdmin"
$Excel01.Quit()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($Excel01) | out-null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment