Hi Chris,
Thank you so much for all your help..Really great i got the output but I can see the following error messages in powershell console,as you mentioned above i have to replace below code with below lines which im getting the errors.
"<tr>" | Out-File $filename -Append
Ex; "<tr> " | Out-File $filename "<td>$machineName</td>" like this please confirm once.
Requesting you to please help me,I' still learning and not the most efficient coder in powershell, so I appreciate if possible can you please kindly modify the script at below lines,it would be great help for me, i will be waiting for your positive response on this.
Add-Content : Stream was not readable.
At line:101 char:2
+ Add-Content $filename "<tr>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:102 char:2
+ Add-Content $filename "<td>$machineName</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:103 char:2
+ Add-Content $filename "<td align=center>$dbname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:115 char:5
+ Add-Content $filename "<td bgcolor='#387C44' align=center>$dbpc</td>" }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:117 char:3
+ Add-Content $filename "</tr>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:101 char:2
+ Add-Content $filename "<tr>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:102 char:2
+ Add-Content $filename "<td>$machineName</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:103 char:2
+ Add-Content $filename "<td align=center>$dbname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:104 char:2
+ Add-Content $filename "<td align=center>$tbname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:105 char:2
+ Add-Content $filename "<td align=center>$ixname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:104 char:2
+ Add-Content $filename "<td align=center>$tbname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:105 char:2
+ Add-Content $filename "<td align=center>$ixname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:110 char:5
+ Add-Content $filename "<td bgcolor='#387C44' align=center>$frg</td>" }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:115 char:5
+ Add-Content $filename "<td bgcolor='#387C44' align=center>$dbpc</td>" }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:117 char:3
+ Add-Content $filename "</tr>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:101 char:2
+ Add-Content $filename "<tr>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:102 char:2
+ Add-Content $filename "<td>$machineName</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Add-Content : Stream was not readable.
At line:103 char:2
+ Add-Content $filename "<td align=center>$dbname</td>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (D:\Test\DBA.htm
tring) [Add-Content], ArgumentException
+ FullyQualifiedErrorId : GetContentWriterArgumentError,Microsoft.PowerShell.Commands.AddContentCommand
Thanks in advance!!
Best Regards,
Kumar DBA