Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Path error

$
0
0


While running this script i am gettin this error , i guess error in specifying path
can u plz check and let me knw how can i remove his error because i need list of all server PSP using this script

PS C:\Users\!admin!> foreach ($computer in (Get-Content -Path C:\listofcomputer.txt) {



Unexpected token '{' in expression or statement.
At line:1 char:66
+ foreach ($computer in (Get-Content -Path C:\listofcomputer.txt) { <<<<
    + CategoryInfo          : ParserError: ({:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

PS C:\Users\!admin!> Get-Item -Path "C:\Windows\System32\CpqMgmt\cqmgstor\cqmgstor.exe" | ForEach-Object {
>> New-Object -TypeName PSCustomObject -Property @{
>> FileName = $_.FullName
>> FileVersion = $_.VersionInfo.FileVersion
>> ProductVersion = $_.VersionInfo.ProductVersion
>> Computer = $Computer
>> } | Select-Object -Property Computer,FileName,FileVersion,ProductVersion


Viewing all articles
Browse latest Browse all 6937

Trending Articles