PowerShell script exchange
Post Reply
rafaelcosta
Lurker
Posts: 2
Liked: never
Joined: Jan 06, 2023 1:40 pm
Full Name: Rafael Costa
Contact:

Association between values and strings

Post by rafaelcosta »

Hey guys,

currently i am creating a script in powershell to get some important metrics for me and I having a little problem
when I get values from VBRSessionState, I see that I can use .ToString() to get the string value: Idle, Pausing, Resuming... and I can also use .value__ to get just numbers: -1,....

in my script I want to use just .value__ to help me in some other stuffs, but I wanted to know how I can associate each possible number of the .value__ to a value of the .ToString()
I just managed to associate the -1 because it was the current state: Stopped
in a job working I got value 5, so I suppose 5 is Working status

can someone help me?
i just want to figure out something like this

X -> Idle
X -> Pausing
X -> Postprocessing
X -> Resume
X -> Starting
-1 -> Stopped
X -> Stopping
X -> WaitingRepository
X -> WaitingTape
5 -> Working
oleg.feoktistov
Veeam Software
Posts: 2011
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Association between values and strings

Post by oleg.feoktistov » 1 person likes this post

Hi Rafael,

The mapping goes like this:

Stopped = -1,
Starting = 3,
Stopping = 4,
Working = 5,
Pausing = 6,
Resuming = 7,
WaitingTape = 8,
Idle = 9,
Postprocessing = 10,
WaitingRepository = 11

Note though that this mapping happens in the internal EState enum, so these integer values are not supported.
Please use with caution and be aware that they can change.

Best regards,
Oleg
rafaelcosta
Lurker
Posts: 2
Liked: never
Joined: Jan 06, 2023 1:40 pm
Full Name: Rafael Costa
Contact:

Re: Association between values and strings

Post by rafaelcosta »

Thx a lot
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests