File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Operation Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,8 @@ async Task StrategyExecuteCmdletAsync(IAsyncCmdlet asyncCmdlet)
187
187
. Select ( nameAndImage => new { OsType = osAndMap . Key , Image = nameAndImage . Value } ) )
188
188
. FirstOrDefault ( ) ;
189
189
190
- OpenPorts = OpenPorts
191
- ?? ( image . OsType == "Windows" ? new [ ] { 3389 , 5985 } : new [ ] { 22 } ) ;
190
+ var isWindows = image . OsType == "Windows" ;
191
+ OpenPorts = OpenPorts ?? ( isWindows ? new [ ] { 3389 , 5985 } : new [ ] { 22 } ) ;
192
192
193
193
var resourceGroup = ResourceGroupStrategy . CreateResourceGroupConfig ( ResourceGroupName ) ;
194
194
var virtualNetwork = resourceGroup . CreateVirtualNetworkConfig (
@@ -224,6 +224,8 @@ async Task StrategyExecuteCmdletAsync(IAsyncCmdlet asyncCmdlet)
224
224
}
225
225
}
226
226
227
+ var fqdn = DomainNameLabel + "." + Location + ".cloudapp.azure.com" ;
228
+
227
229
// create target state
228
230
var target = virtualMachine . GetTargetState ( current , client . SubscriptionId , Location ) ;
229
231
@@ -238,6 +240,10 @@ async Task StrategyExecuteCmdletAsync(IAsyncCmdlet asyncCmdlet)
238
240
239
241
var result = newState . Get ( virtualMachine ) ;
240
242
var psResult = ComputeAutoMapperProfile . Mapper . Map < PSVirtualMachine > ( result ) ;
243
+ psResult . Fqdn = fqdn ;
244
+ asyncCmdlet . WriteVerbose ( isWindows
245
+ ? "Use 'mstsc /v:" + fqdn + "' to connect to the VM."
246
+ : "Use 'ssh " + Credential . UserName + "@" + fqdn + "' to connect to the VM." ) ;
241
247
asyncCmdlet . WriteObject ( psResult ) ;
242
248
}
243
249
You can’t perform that action at this time.
0 commit comments