views:

306

answers:

1

Hello everyone,

I am using PowerShell 1.0 on Windows Server 2003 x64. When executing the following statement, there is error below. Not every time this error occurs, and if this error occurs and I execute this command again, there is no error again! It is so weird. Any ideas what is wrong?

Stop-Service "SQLServerAgent" -Force -ErrorAction:stop

WARNING: Waiting for service 'SQL Server Agent (MSSQLSERVER) (SQLSERVERAGENT)' 
to finish stopping...
out-lineoutput : The OS handle's position is not what FileStream expected. Do n
ot use a handle simultaneously in one FileStream and in Win32 code or another F
ileStream. This may cause data loss.

thanks in advance, George

+4  A: 

This is bug in PowerShell.

Please see Lee Holmes' post for a Workaround: The OS handle's position is not what FileStream expected

Mitch Wheat
Thanks, good to learn from you.
George2