Issue with " Get-Item -Path $param1 -Stream * "

When I execute the below command in Powershell, " Get-Item -Path path-to-file -Stream * ", I get an output which is different when its executed within the form l load script of Powerscript pro.

May I seek some clarification here. Ideally, I like to get the same value in both environments.

Hey @MuruGuru,

Can you paste the output you are seeing? I will try locally but it would be nice to compare.

Thanks for your response.

Within Powershell Pro Visual Studio 2019 Environment, In my Form_load,

The variable $hasTags contains “System.Management.Automation.Internal.AlternateStreamData” after execution of the below code.

$hasTags=Get-Item -Path $param1 -Stream *

Where as I get the below output in Powershell Native Interface when I execute “Get-Item -Path path-to-file -Stream *”

PSPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\Administrator\$D
PSParentPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\Administrator
PSChildName :$DATA
PSDrive : C
PSProvider : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : False
FileName : C:\Users\Administrator\
Stream : :$DATA
Length : 26940873

Please give some hint to proceed further. Its a roadblock for me…

I am seeing the same output in both PowerShell.exe and VS.

Thanks Adam
I believe there is a communication gap here. I run Powershell Pro Tool code within VS project. Please refer my 24th Jul posting. It certainly differs.

I see that it differs but I guess I’m unclear as to how to achieved the different output. Are you running it through the debugger or within the PowerShell Interactive Window?

Hi Adam
Just want to keep you posted that I had worked around this issue. I kind of suspect that it may be possible Get-Item returns an object reference when assigned to a variable within Powerscript Pro environment. Whereas it returns full output when run in Poweshell environment.

I thank you for your time.

1 Like