I\'m currently trying to incorporate a process for setting up Spark/Hadoop on a teststack into our powershell script.
It\'s a windows environment and a few bits are thro
Using the PowerShell environment variable syntax ($env:VARIABLE
) instead of the batch syntax (%VARIABLE%
) should suffice. Note that you must use the call operator for this to work. I'd also recommend adding double quotes in case there are spaces in the path.
& "${env:HADOOP_HOME}\bin\winutils.exe" chmod 777 /tmp/hive
The need for the call operator appears to be due to PowerShell's command parser not recognizing an expression $variable\something
as a path. Without the &
you'd be getting an an exception
Unexpected token '\bin\winutils.exe' in expression or statement.