Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Im trying to generate a CSV file from a remote PSession if I run the commands from PowerShell everything works fine If I run them from the Powershell Studio exported .ps1 script it generates a blank csv file. I can not get the .ps1 file to return any results. All variables also show correctly when I write-host or enter a value directly into the script. There are no errors generated around getting or writing data either. I have a feeling I'm just missing a Powershell Studio vs Powershell Syntax somewhere.
With this it is filtering something but if the value of $Filename is E:\Data\Some Folder Im getting all sorts of results like:
D:\data\corp\contact
F:\HomeDrive\someguy
I was able to use part of the suggested solution but I could never get the results to return what I was actually looking for. Below is what I'm currently using and is filtering based off of the supplied variable. The $csv gets imported into a datagrid that displays the results. Thanks for all the help.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.