Search code examples
buffercommand-line-argumentsazure-powershell

What is the term/command "make-buff" when used in a script?


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.


Solution

  • 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)

    enter image description here

    Here I used emo function as below:

     function emo($e)
     {write-host "$e"}
     emo "Rithwik Started" 
    

    enter image description here

    So, now you clearly understand it is a user defined function, So, basically it is a function it is called like below."

    FunctionName argumnets