I am executing following code but facing error in PowerShell 2.0 while code works fine in latest version, please help is there any Snapin to solve this or any other solution except updating the PowerShell. Thanks in advance.
Code:
Write-Output $a |Tee-Object -FilePath $fileName
Write-Output("Please wait components deletion is in progress")|Tee-Object -FilePath $fileName -Append
Error:
Tee-Object : A parameter cannot be found that matches parameter name 'Append'.
At line:1 char:102
+ Write-Output("Please wait components deletion is in progress")|Tee- Object -FilePath $fileName -Append
+ CategoryInfo : InvalidArgument: (:) [Tee-Object], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.TeeObjectCommand