Skip to content

Commit 475a8b6

Browse files
committed
Adapt data collection cmdlets to new registry
1 parent 7174b7d commit 475a8b6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ServiceManagement/Profile/Commands.Profile/DataCollection/EnableAzureDataCollection.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.Common.Authentication;
16+
using Microsoft.WindowsAzure.Commands.Common;
1517
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1618
using System.Management.Automation;
1719
using System.Security.Permissions;
@@ -29,9 +31,10 @@ public override void ExecuteCmdlet()
2931

3032
protected void SetDataCollectionProfile(bool enable)
3133
{
32-
var profile = GetDataCollectionProfile();
34+
var profile = _dataCollectionProfile;
3335
profile.EnableAzureDataCollection = enable;
34-
SaveDataCollectionProfile();
36+
DataCollectionController.WritePSDataCollectionProfile(AzureSession.Instance, profile);
37+
AzureSession.Instance.RegisterComponent(DataCollectionController.RegistryKey, () => DataCollectionController.Create(profile), true);
3538
}
3639
}
3740
}

0 commit comments

Comments
 (0)