I think this is related to powershell issue as it has worked on my mac (bash script).
Here\'s the one working in bash:
kubectl create secret docker-registr