I have a module of PS commands written in C#. It communicates with another DLL, that eventually writes a file.
Let's assume Powershell from the Windows Terminal. It starts in C:\Users\<myname>\
.
Export-Yadda -filename .\bla.txt
will create a file bla.txt
in C:\Users\<myname>\
When I cd
to C:\users\<myname>\foo\
and repeat the command, it will still write to C:\users\<myname>\
This has me a at a bit of a loss.
The part of the code that receives the bla.txt
string could not be simpler, it is just:
private string _path;
public string OutputPath
{
get { return _path; }
set { _path = value; }
}
Magic is being applied to bla.txt
to make it a FQPN. How do I make it reflect the path the command was issued from? So that I can call it from say C:\<whatever>
or E:\temp\
?