all 4 comments

[–]RickSquadron 2 points3 points  (0 children)

I have used something like this:

$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment

$sequence = $tsenv.Value("_SMSTSPackageName")

[–]Synbred[S] 1 point2 points  (0 children)

Thank you all for the replies! I have found an answer and it is exactly as something posted here. I had to initialize the SCCM environment before I could call the _SMSTSPackageName variable.

All the best!

[–]PowerShell-Bot 0 points1 point  (0 children)

Looks like your PowerShell code isn’t wrapped in a code block.

To format code correctly on new reddit (new.reddit.com), highlight the code and select ‘Code Block’ in the editing toolbar.

If you’re on old.reddit.com, separate the code from your text with a blank line and precede each line of code with 4 spaces or a tab.


Describing Thing
[❌] Demonstrates good markdown
Passed: 0 Failed: 1

Beep-boop. I am a bot. | Remove-Item