I am new to Powershell, and I need help on the following:
I put a script where a varibale is processed and then passed on to a command within the same script, the issue is that this command fails because it does not take the variabe , but i know for sure that the varibale has the right value, can somebody please explain to me what is wrong\missing, example below
to run the above " script /vol/vol1/qt1/username username "
the output is
this is quota line
You cannot call a method on a null-valued expression.
At U:\powershell\aa.ps1:8 char:1
+ $q= $ql.Replace($pathd," ")
+ CategoryInfo : InvalidOperation: (:) , RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
so $q fails because $ql is empty, and I can not figure out why, $pathd is correctly processed and its value is " /vol/vol1/qt1/"
$ql works fine if I pass the variable direclty as "/vol/vol1/qt1/" and it gets the value of "600"
qline.txt contains the lines below