PSObject is used for object encapsulation in PowerShell and is used for a consistent view in its environment.
Questions tagged [psobject]
174 questions
0
votes
1 answer
PowerShell local disk property no output
I am building report for disk but need help, please. Here is the code:
$outputs = @()
$disks = get-wmiobject -class "Win32_LogicalDisk" -Filter 'driveType=3' -namespace "root\CIMV2"
foreach ( $disk in $disks ) {
$output = New-Object PSObject…

andrej
- 547
- 1
- 6
- 21
0
votes
1 answer
Export-csv formatting. Powershell
Let's start off by saying that I'm quite new to Powershell and not the greatest one working with it's code and scripts but trying to learn. And now to the problem!
I'm working on a script that fetches information from computers in the network. I've…

Azely
- 77
- 1
- 2
- 6
0
votes
1 answer
How can you evaluate a string on PSObjects?
I am still very new to the concept of objects and can't wrap my head around this:
PS C:\Windows\system32> $obj1 = New-Object psobject
$obj1 | Add-Member -NotePropertyName Whatever -NotePropertyValue "blah"
$obj2 = New-Object psobject
$obj2 |…

Bluz
- 5,980
- 11
- 32
- 40
0
votes
2 answers
C# Powershell Pipeline output/response
currently I'm developing a c# web service which is a "man in the middle".
The Client can call a method "executeScript(String script)" and my web services invokes the script.
Currently the web service doesn't know which scripts the client will…

Danny.
- 363
- 1
- 4
- 23
0
votes
2 answers
PowerShell - Select-Object from Win32_OperatingSystem displays rather oddly
First time poster here, I'm a bit of a beginner and I've been keen to get my PowerShell scripting skills up to scratch and I'm come across something rather confusing...
I've made a script to query a collection of computers and I want to query…

Astirian
- 63
- 1
- 10
0
votes
1 answer
Passing custom object array to a function
I'm trying to pass an array of custom objects to a function for further processing of these objects.
Here's the function where I create my custom object array:
Function GetNetworkAdapterList
{
# Get a list of available Adapters
$hnet =…

donhector
- 875
- 1
- 10
- 21
0
votes
1 answer
Powershell Find specific row (querying) psobject
I'm new to Powershell. And I'm struggling with the most simplest of tasks.
OK. This is a really stupid question, but I have created a PSObject ... added members (4 columns, ID, Name, Status, TagFile; a number of rows) ... I have a loop ... for each…

SuperSooty
- 81
- 4
- 9
0
votes
1 answer
Pass collection of C# Psobjects to powershell pipeline
I have a collection of C# PSObjects that i want to pass to a powershell script. I like to pass it in the pipeline so i can use it in the process section of the psfile.
Anyone have any clue if this is possible or not and in that case. How do i do…

Borderman
- 21
- 3
-1
votes
1 answer
Compare-Object not saving to CSV correctly
What I'm trying to do is compare the data from two pscustomobject arrays, Then have the data that doesnt matches saved into an array. That array will then be exported to a CSV file. This is what i have.
function DataCompare {
$NotMatch =…

Selene
- 31
- 6