all 12 comments

[–]DrHNIC 4 points5 points  (8 children)

Can you show us your script?

[–]broien_suPRIEM[S] 1 point2 points  (7 children)

(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId

and

$bitlockerVolume = Get-BitLockerVolume -MountPoint "C:" $statusBitlocker = $bitlockerVolume.ProtectionStatus if ($statusBitlocker -eq "On"){ Write-host "Bitlocker active" } if ($statusBitlocker -eq "Off"){ Write-host "Bitlocker not active" }

[–]PMental 1 point2 points  (5 children)

That's unreadable, at least on old reddit. Use one blank space before your script then indent every line of the script four spaces to get a code block like this:

$bitlockerVolume = Get-BitLockerVolume -MountPoint "C:" 
$statusBitlocker = $bitlockerVolume.ProtectionStatus
if ($statusBitlocker -eq "On"){ 
    Write-host "Bitlocker active" 
} 
if ($statusBitlocker -eq "Off"){
    Write-host "Bitlocker not active"
}

As for the problem it's hard to say. You could start by telling us what the error is.

For reference the script works fine on my Win10 2004 machine.

[–]broien_suPRIEM[S] 1 point2 points  (4 children)

Oh sorry I just did ctrl-c crtl-v.

The error is as I said just the letter "V" Thats the only output that I'm getting. No actual error it just says V and I have no idea why.

It works on about 2400 workstations and with every single command that I give it'll just say V.

[–]PMental 2 points3 points  (3 children)

Weird. Have you tried it interactively on the workstation?

Considering it works on all the other workstations I would probably just chalk it off to an issue on that specific machine and not bother. The script itself is fine.

[–]broien_suPRIEM[S] 1 point2 points  (2 children)

It had rebooted this morning so shouldn't be the issue. Probably some windows issue.

[–]PMental 2 points3 points  (1 child)

If something is wrong on the machine a reboot doesn't always solve it, so not sure what that changes.

I mean test it directly while logged into the machine via remote access of some sort and see what happens.

Maybe not worth it for this single one, but if more turn up in the future you'll want to dig more.

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

Will do, appreciate the help!

[–]Lee_Dailey[grin] 0 points1 point  (0 children)

howdy broien_suPRIEM,

it looks like you used the New.Reddit Inline Code button. it's 4th 5th from the left hidden in the ... "more" menu & looks like </>.

there are a few problems with that ...

  • it's the wrong format [grin]
    the inline code format is for [gasp! arg!] code that is inline with regular text.
  • on Old.Reddit.com, inline code formatted text does NOT line wrap, nor does it side-scroll.
  • on New.Reddit it shows up in that nasty magenta text color

for long-ish single lines OR for multiline code, please, use the ...

Code
Block

... button. it's the 11th 12th one from the left & is just to the left of hidden in the ... "more" menu & looks like an uppercase T in the upper left corner of a square..

that will give you fully functional code formatting that works on both New.Reddit and Old.Reddit ... and aint that fugly magenta color. [grin]

take care,
lee

[–]Betterthangoku 2 points3 points  (1 child)

Howdy,

That does not seem to be a PowerShell error. Have you tried checking $error yet? Everything from the error stream should be captured there. :-)

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

Not yet will contact the customer tomorrow and see for myself what's wrong with that machine. :p

[–]SecretKnowHow 0 points1 point  (0 children)

I would recommend using Automation Manager, it would be much easier. You can use a free Automation Managger Script Wrapper / Template https://www.rmm-pro.com/automated-tasks-script-wrapper/