title: How to get the instance id of the instance being created inside the user data of CFT via powershell?
body: <p>I was successfully able to attach another instance id from inside powershell if aws ec2 windows instance using CFT.</p>
  
  <p>Can someone please help me how to get the instance id of the instance being created as I need to use inside the user data for ELB registration. So, in simpler words, i want to register the same instance that i am creating.</p>
  
  <p>Below is my working command :-</p>
  
  <blockquote>
    <p>Register-ELBInstanceWithLoadBalancer -LoadBalancerName ire798ELB
    -Instances i-b90d8d06 -Region us-east-1</p>
  </blockquote>
  
  <p>But here <code>i-b90d8d06</code> is some other instance id and not the one i am creating.</p>