Relative Content

Tag Archive for c#powershell

PSCustomObject with different string types

I have a workflow that is pretty picky with the PSCustomObjects it receives. I often use Select-Object to get the properties from the objects I want to keep and sometimes I need to convert some of the values to more usable formats. The easiest way to do this is to use the @{Name='Name'; Expression = {'Expression'}} technique.

Powershell Enter-PSSession command doesn’t work in studio

I m new in PS stuff, I develop st in c#, that connect a remote machine and start a few exe for me.
I tried some ps code for connect and start an exe in remote server. It s worked ok.
But i couldn’t get same result in c#.
My ps code in c# worked ok in local operation.

How to define string representation of my class object in PowerShell?

I’m trying to make some PowerShell cmdlets in C# and created a DataChunk class for storing binary data. It just holding byte[] array. The goal was to read bytes from file into DataChunk to show it how I need it. So I wrote ToString() method. But it seems that PowerShell not using it. Why?

How to turn on warnings for C 6.3.0 version?

I’m staring to learn C, and via help of youtube I could download 6.3.0 version, though my textbook is referring to 4.3.3.
I’m purposefully trying to get a warnings for a Hello World program without getting an error, but I don’t get any. I took away return(0) and then took away the second quote mark in printf, but PowerShell just executes the program after compilation without giving me any warnings.