title: Azure Cloud Service Startup task that needs to run a PowerShell script
body: <p>All,</p>
  
  <p><strong><em>Note:</em></strong> I have updated the question after some feedback.</p>
  
  <p>Thanks to <strong><em>@jisaak</em></strong> for his help so far.</p>
  
  <p>I have the need to run a PowerShell script that adds TCP bindings and some other stuff when I deploy my Cloud Service.</p>
  
  <p>Here is my Cloud Service Project:</p>
  
  <p><a href="https://i.stack.imgur.com/2uYPI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2uYPI.png" alt="enter image description here"></a></p>
  
  <p>Here is my Cloud Service Project and Webrole project:
  <a href="https://i.stack.imgur.com/KKMwf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KKMwf.png" alt="enter image description here"></a></p>
  
  <p>Here is my task in ServiceDefinition.csdef:<a href="https://i.stack.imgur.com/eNfH5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eNfH5.png" alt="enter image description here"></a></p>
  
  <p>And here is the PowerShell script I want to run:
  <a href="https://i.stack.imgur.com/cteYz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cteYz.png" alt="enter image description here"></a></p>
  
  <p>here is my attempt at the Startup.cmd:
  <a href="https://i.stack.imgur.com/GuDd4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GuDd4.png" alt="enter image description here"></a></p>
  
  <p>When I deploy I get this in the Azure log:
  <a href="https://i.stack.imgur.com/UJBcy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UJBcy.png" alt="enter image description here"></a></p>
  
  <p>And this in the powershell log:
  <a href="https://i.stack.imgur.com/zcSTY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zcSTY.png" alt="enter image description here"></a></p>
  
  <p>Any help would be very much appreciated.</p>
  
  <p>I think I am nearly there but following other people syntax on the web doesn't seem to get me there.</p>
  
  <p>thanks
  Russ</p>