Noob to PS, but I know bash and batch.
I'm trying to do a simple script that tests the existence of a file and then creates another depending on the outcome, but prompts me for a parameter value after running it.
Code:
I've tried running it as a function and just as a two line script, but it still produces the same result.
Prompt:
Thanks.
I'm trying to do a simple script that tests the existence of a file and then creates another depending on the outcome, but prompts me for a parameter value after running it.
Code:
Code:
function test-existence {
if(test-path -path "C:\testran.flag") {echo > C:\users\admin\desktop\true.flag}
if(!(test-path -path "C:\testfailed.flag")) {echo > C:\users\admin\desktop\false.flag}
test-existence
Prompt:
This is part of a fully automated setup so I need this to run without any user interaction.Supply values for the following parameters:
InputObject[0]:
Thanks.
My Computer
At a glance
Windows 7 Professional 32bit
- OS
- Windows 7 Professional 32bit