I initially had profile path in the csv file but the cmdlet doesnot not accept pipeline for this paramater which for me as a new student to powershell I have not yet solved.
If anyone could shine some light to resolve this currnet problem.
BTW - I am trying to figure out how to do inception based powershell i.e. pipe to a variable within a variable
Any deeper and I might not make it out!
You’re not actually piping Import-Csv to anything other than ForEach-Object here, so you could put the path in the CSV file if you like. That would look something like this:
Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.
+ CategoryInfo : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [], PSInvalidOperationEx
ception
+ FullyQualifiedErrorId : RemotePipelineExecutionFailed
For this reason, and because piping is actually quite slow when dealing with larger quantities of data, and it makes code look like Perl (Perl isn’t bad, it’s just ugly), I’ve found myself using it less and less in favor of saving data in variables and then using a proper foreach($item in $list) { } structure.