i am running a powershell command through SQL,please find below code
declare @sql varchar(200)
set @sql = 'powershell.exe Get-WmiObject -Class MSFT_PhysicalDisk -Namespace root\Microsoft\Windows\Storage| select FriendlyName'
EXEC xp_cmdshell @sql
its gives me output
output
'select' is not recognized as an internal or external command,
operable program or batch file.
NULL
why it is giving like that if i remove select than powershell command is working