get-content inside a script
hi have basic question get-content inside script...
for example have next script:
param($input)
gc (gci $input ).fullname
if past code in console don't have problem, in script have following error:
get-content : cannot bind argument parameter 'path' because null.
at line:1 char:3
+ gc <<<< $as
+ categoryinfo : invaliddata: (:) [get-content], parameterbinding
validationexception
+ fullyqualifiederrorid : parameterargumentvalidationerrornullnotallowed,m
icrosoft.powershell.commands.getcontentcommand
what problem?
$input special variable in powershell, bad idea give own variable same name. see get-help about_automatic_variables more info on $input is.
this issue - try renaming paramter different $filepath , see if starts working.
thanks,
-lincoln
Windows Server > Windows PowerShell
Comments
Post a Comment