@@ -664,17 +664,15 @@ public CertificateProvider()
664664 //
665665 // create and cache CurrentUser store-location
666666 //
667- X509StoreLocation user =
668- new ( StoreLocation . CurrentUser ) ;
667+ X509StoreLocation user = new ( StoreLocation . CurrentUser ) ;
669668 s_storeLocations . Add ( user ) ;
670669 AddItemToCache ( nameof ( StoreLocation . CurrentUser ) ,
671670 user ) ;
672671
673672 //
674673 // create and cache LocalMachine store-location
675674 //
676- X509StoreLocation machine =
677- new ( StoreLocation . LocalMachine ) ;
675+ X509StoreLocation machine = new ( StoreLocation . LocalMachine ) ;
678676 s_storeLocations . Add ( machine ) ;
679677 AddItemToCache ( nameof ( StoreLocation . LocalMachine ) ,
680678 machine ) ;
@@ -997,9 +995,7 @@ protected override void NewItem(
997995 fResult = Security . NativeMethods . CertCloseStore ( hCertStore , 0 ) ;
998996 }
999997
1000- X509Store outStore = new (
1001- pathElements [ 1 ] ,
1002- StoreLocation . LocalMachine ) ;
998+ X509Store outStore = new ( pathElements [ 1 ] , StoreLocation . LocalMachine ) ;
1003999 WriteItemObject ( outStore , path , true ) ;
10041000 }
10051001
@@ -1016,13 +1012,12 @@ protected override Collection<PSDriveInfo> InitializeDefaultDrives()
10161012 {
10171013 string providerDescription = CertificateProviderStrings . CertProvidername ;
10181014
1019- PSDriveInfo drive =
1020- new (
1021- "Cert" , // drive name
1022- ProviderInfo , // provider name
1023- @"\" , // root path
1024- providerDescription ,
1025- null ) ;
1015+ PSDriveInfo drive = new (
1016+ name : "Cert" ,
1017+ provider : ProviderInfo ,
1018+ root : @"\" ,
1019+ providerDescription ,
1020+ credential : null ) ;
10261021
10271022 Collection < PSDriveInfo > drives = new ( ) ;
10281023 drives . Add ( drive ) ;
@@ -1274,9 +1269,7 @@ protected override void GetItem(string path)
12741269 if ( store != null )
12751270 {
12761271 // create X509Store
1277- X509Store outStore = new (
1278- store . StoreName ,
1279- store . Location . Location ) ;
1272+ X509Store outStore = new ( store . StoreName , store . Location . Location ) ;
12801273 WriteItemObject ( outStore , path , isContainer ) ;
12811274 }
12821275 }
@@ -1506,11 +1499,11 @@ private static ErrorRecord CreateErrorRecord(string path,
15061499 break ;
15071500 }
15081501
1509- ErrorRecord er =
1510- new ( e ,
1511- "CertProviderItemNotFound" ,
1512- ErrorCategory . ObjectNotFound ,
1513- null ) ;
1502+ ErrorRecord er = new (
1503+ e ,
1504+ "CertProviderItemNotFound" ,
1505+ ErrorCategory . ObjectNotFound ,
1506+ targetObject : null ) ;
15141507
15151508 er . ErrorDetails = ed ;
15161509
@@ -1543,10 +1536,10 @@ private void ThrowErrorRemoting(int stat)
15431536 private void ThrowInvalidOperation ( string errorId , string message )
15441537 {
15451538 ErrorRecord errorRecord = new (
1546- new InvalidOperationException ( message ) ,
1547- errorId ,
1548- ErrorCategory . InvalidOperation ,
1549- null ) ;
1539+ new InvalidOperationException ( message ) ,
1540+ errorId ,
1541+ ErrorCategory . InvalidOperation ,
1542+ targetObject : null ) ;
15501543 errorRecord . ErrorDetails = new ErrorDetails ( message ) ;
15511544 ThrowTerminatingError ( errorRecord ) ;
15521545
@@ -2595,9 +2588,7 @@ private void GetStoresOrNames(
25952588 else
25962589 {
25972590 X509NativeStore store = GetStore ( storePath , name , location ) ;
2598- X509Store ManagedStore = new (
2599- store . StoreName ,
2600- store . Location . Location ) ;
2591+ X509Store ManagedStore = new ( store . StoreName , store . Location . Location ) ;
26012592 thingToReturn = ManagedStore ;
26022593 }
26032594
@@ -3581,8 +3572,7 @@ internal static List<string> GetStoreNamesAtLocation(StoreLocation location)
35813572 break ;
35823573 }
35833574
3584- Security . NativeMethods . CertEnumSystemStoreCallBackProto callBack =
3585- new ( CertEnumSystemStoreCallBack ) ;
3575+ Security . NativeMethods . CertEnumSystemStoreCallBackProto callBack = new ( CertEnumSystemStoreCallBack ) ;
35863576
35873577 // Return a new list to avoid synchronization issues.
35883578
0 commit comments