Get-Process Missing Exe Properties

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
lpalacio
Posts: 13
Last visit: Wed Mar 13, 2024 6:42 am

Get-Process Missing Exe Properties

Post by lpalacio »

I have a compiled script and I'm adding some features to allow automatic updates and prevention of multiple executable executions but when I run Get-Process against the currently running exe it doesn't return all the properties correctly even if I filled them out in the compiler window. For example:

Code: Select all

PS> get-process | ? {$_.ProcessName -eq "Test-Agent"} | select *


Name                       : Test-Agent
Id                         : 9292
PriorityClass              :
FileVersion                : --MISSING??--
HandleCount                : 521
WorkingSet                 : 71876608
PagedMemorySize            : 49467392
PrivateMemorySize          : 49467392
VirtualMemorySize          : 667238400
TotalProcessorTime         :
SI                         : 0
Handles                    : 521
VM                         : 667238400
WS                         : 71876608
PM                         : 49467392
NPM                        : 45568
Path                       :
Company                    :--MISSING??--
CPU                        :
ProductVersion             :--MISSING??--
Description                :--MISSING??--
Product                    :--MISSING??--
__NounName                 : Process
BasePriority               : 8
ExitCode                   :
HasExited                  :
ExitTime                   :
Handle                     :
SafeHandle                 :
MachineName                : .
MainWindowHandle           : 0
MainWindowTitle            :
MainModule                 :
MaxWorkingSet              :
MinWorkingSet              :
Modules                    :
NonpagedSystemMemorySize   : 45568
NonpagedSystemMemorySize64 : 45568
PagedMemorySize64          : 49467392
PagedSystemMemorySize      : 484008
PagedSystemMemorySize64    : 484008
PeakPagedMemorySize        : 61530112
PeakPagedMemorySize64      : 61530112
PeakWorkingSet             : 73080832
PeakWorkingSet64           : 73080832
PeakVirtualMemorySize      : 691826688
PeakVirtualMemorySize64    : 691826688
PriorityBoostEnabled       :
PrivateMemorySize64        : 49467392
PrivilegedProcessorTime    :
ProcessName                : Test-Agent
ProcessorAffinity          :
Responding                 : True
SessionId                  : 0
StartInfo                  : System.Diagnostics.ProcessStartInfo
StartTime                  :
SynchronizingObject        :
Threads                    : {3600, 15904, 10160, 3536...}
UserProcessorTime          :
VirtualMemorySize64        : 667238400
EnableRaisingEvents        : False
StandardInput              :
StandardOutput             :
StandardError              :
WorkingSet64               : 71876608
Site                       :
Container                  :

Is there a way to get those properties filled?

The exe is compiled with the PS v5 Host (Windows Service) engine.

Product, version and build:
5.4.145 x64
Operating system:
W10 1709 x64
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Get-Process Missing Exe Properties

Post by mxtrinidad »

Can you provide us with the screen shot of the Script Packager 'version information' settings? This can help us troubleshoot the issue.

Thx
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Get-Process Missing Exe Properties

Post by mxtrinidad »

Just did a test on a running process and found no missing properties information.

Code: Select all

Get-Process -Name "VRKTray" | Select-Object -Property * | Get-Member -MemberType pro* | Select-Object Name

Name
----
BasePriority
Company
Container
CPU
Description
EnableRaisingEvents
ExitCode
ExitTime
FileVersion
Handle
HandleCount
Handles
HasExited
Id
MachineName
MainModule
MainWindowHandle
MainWindowTitle
MaxWorkingSet
MinWorkingSet
Modules
Name
NonpagedSystemMemorySize
NonpagedSystemMemorySize64
NPM
PagedMemorySize
PagedMemorySize64
PagedSystemMemorySize
PagedSystemMemorySize64
Path
PeakPagedMemorySize
PeakPagedMemorySize64
PeakVirtualMemorySize
PeakVirtualMemorySize64
PeakWorkingSet
PeakWorkingSet64
PM
PriorityBoostEnabled
PriorityClass
PrivateMemorySize
PrivateMemorySize64
PrivilegedProcessorTime
ProcessName
ProcessorAffinity
Product
ProductVersion
Responding
SafeHandle
SessionId
SI
Site
StandardError
StandardInput
StandardOutput
StartInfo
StartTime
SynchronizingObject
Threads
TotalProcessorTime
UserProcessorTime
VirtualMemorySize
VirtualMemorySize64
VM
WorkingSet
WorkingSet64
WS
__NounName
Can you explain which one(s) are missing?

Thx
User avatar
lpalacio
Posts: 13
Last visit: Wed Mar 13, 2024 6:42 am

Re: Get-Process Missing Exe Properties

Post by lpalacio »

See screenshot below.

https://imgur.com/a/kV8DZ

On the first post I marked the properties that are missing with "MISSING??"

Thanks.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Get-Process Missing Exe Properties

Post by davidc »

Please verify that the generated executable also has these properties set (Right-Click on the exe->Properties->Details).

And does the package executable use RunAs or Impersonate?
David
SAPIEN Technologies, Inc.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Get-Process Missing Exe Properties

Post by mxtrinidad »

The version information you provided looks good. Now, what about under "Installer" section in the "Product Detail".
Are you creating an MSI installer for it?

Also, there's the possibility of creating the executable in a different location and not running with the updated detail information.

Everything shown in your print-screen looks good and should display the information in the Get-Process.
User avatar
lpalacio
Posts: 13
Last visit: Wed Mar 13, 2024 6:42 am

Re: Get-Process Missing Exe Properties

Post by lpalacio »

I figured it out. It turns out that if I pipe Get-Process (without a filter) to Where-Object the properties aren't there.

If I filter from Get-Process then the properties are there.

Thanks for the assist.
User avatar
lpalacio
Posts: 13
Last visit: Wed Mar 13, 2024 6:42 am

Re: Get-Process Missing Exe Properties

Post by lpalacio »

Nvm my last post. The issue ended up being UAC, the PS instance had to be running with admin privileges to retrieve all the properties from the object.
This topic is 6 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.