Looking for help making new index files
Posted: Mon Oct 01, 2012 3:52 am
Hi! I am using PowerShell to create an index file for NetApp's PowerShell toolkit. I have the XML file, but when I try to run the commands listed in the help I see the following:
PS C:ontap> $namespace = @{command="http://schemas.microsoft.com/maml/dev/command/2004/10"; maml="http://schemas.micros
oft.com/maml/2004/10"; dev="http://schemas.microsoft.com/maml/dev/2004/10"}
PS C:ontap> $xml = select-xml -path "$pwdDataONTAP.C.dll-Help.xml"; -namespace $namespace -xpath "//command:name"
Missing expression after unary operator '-'.
At line:1 char:59
+ $xml = select-xml -path "$pwdDataONTAP.C.dll-Help.xml"; - $namespace = @{command="http://schemas.microsoft.com/maml/dev/command/2004/10"; maml="http://schemas.micros
oft.com/maml/2004/10"; dev="http://schemas.microsoft.com/maml/dev/2004/10"}
PS C:ontap> $xml = select-xml -path "$pwdDataONTAP.C.dll-Help.xml" -namespace $namespace -xpath "//command:name"
PS C:ontap>
PS C:ontap> $xml | ForEach -Object{$_.Node.InnerText.Trim()} | Set-Content -Path c:ontapDataONTAP.C.dll-Help.index
ForEach-Object : Cannot bind parameter 'Process'. Cannot convert the "-Object" value of type "System.String" to type "S
ystem.Management.Automation.ScriptBlock".
At line:1 char:15
+ $xml | ForEach <<<< -Object{$_.Node.InnerText.Trim()} | Set-Content -Path c:ontapDataONTAP.C.dll-Help.index
+ CategoryInfo : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ForEachObjectCommand
Has Powershell's syntax changed for getting these XML files parsed? Any help would be appreciated!
PS C:ontap> $namespace = @{command="http://schemas.microsoft.com/maml/dev/command/2004/10"; maml="http://schemas.micros
oft.com/maml/2004/10"; dev="http://schemas.microsoft.com/maml/dev/2004/10"}
PS C:ontap> $xml = select-xml -path "$pwdDataONTAP.C.dll-Help.xml"; -namespace $namespace -xpath "//command:name"
Missing expression after unary operator '-'.
At line:1 char:59
+ $xml = select-xml -path "$pwdDataONTAP.C.dll-Help.xml"; - $namespace = @{command="http://schemas.microsoft.com/maml/dev/command/2004/10"; maml="http://schemas.micros
oft.com/maml/2004/10"; dev="http://schemas.microsoft.com/maml/dev/2004/10"}
PS C:ontap> $xml = select-xml -path "$pwdDataONTAP.C.dll-Help.xml" -namespace $namespace -xpath "//command:name"
PS C:ontap>
PS C:ontap> $xml | ForEach -Object{$_.Node.InnerText.Trim()} | Set-Content -Path c:ontapDataONTAP.C.dll-Help.index
ForEach-Object : Cannot bind parameter 'Process'. Cannot convert the "-Object" value of type "System.String" to type "S
ystem.Management.Automation.ScriptBlock".
At line:1 char:15
+ $xml | ForEach <<<< -Object{$_.Node.InnerText.Trim()} | Set-Content -Path c:ontapDataONTAP.C.dll-Help.index
+ CategoryInfo : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ForEachObjectCommand
Has Powershell's syntax changed for getting these XML files parsed? Any help would be appreciated!