I have a script given to me by a colleague, however it has a command in it that I cannot find any results on. Sample is below. Colleague is no longer available to ask.
#create a buffer in the log
function make-buff($spot)
{write-host "`n`n####################$spot##########################`n`n"}
make-buff "Script Start"
$errormark = 0
The command is used in a PowerShell script. Thanks in advance for any assistance.
I am just trying to determine what the command is and does.
It(make buff) is a user defined non built in PowerShell command. These functions are used for creating buffers in logs or sending data(Basically it is a function).
In your script make-buff
is used as dynamic variable initializing. ( Suppose a variable value depends on an execution of particular statement or previous statements value)
Here I used emo function as below:
function emo($e)
{write-host "$e"}
emo "Rithwik Started"
So, now you clearly understand it is a user defined function, So, basically it is a function it is called like below."
FunctionName argumnets