Executing scripts on Windows is different because it uses PowerShell rather than bash, and a large number of other considerations. For this, and the scripts which follow, make these changes.
Powershell script filenames must end with the .ps1 extension. For most of these scripts, that's all that is required because the scripts are so simple. To execute the script, simply type .\scriptname.ps1 in the Powershell window. In other words, on Windows, the script just shown must be named buildauthnet.ps1, and is executed as .\buildauthnet.ps1.
To execute the scripts, you may need to change the Powershell Execution Policy:
PS C:\Users\david\chap10\authnet> Get-ExecutionPolicy
Restricted
PS C:\Users\david\chap10\authnet> Set-ExecutionPolicy Unrestricted
Obviously, there are security considerations with this change, so change the Execution Policy back when you're done.
A simpler method on Windows is to simply paste these commands into a PowerShell window.