rodneyviana / ODSyncUtil

MIT License
14 stars 5 forks source link

Get-ODStatusFromDLL Error #15

Open aakash-shah opened 6 months ago

aakash-shah commented 6 months ago

Hello! I am able to use and run Get-ODStatus. But in case you need feedback/testing for Get-ODStatusFromDLL, FYI I get this error when attempting to run it on Win11 23H2 on one of my computers:

PS D:\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1
MaxSize: 4096 / Type: ulong
MethodInvocationException: D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42
Line |
  42 |      $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "GetODSyncStatus" with "4" argument(s): "Value cannot be null. (Parameter 'path1')"
Write-Error: Call to GetODSyncStatus failed. HRESULT:
Write-Error: Size: 0

            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size

And on a second Win11 23H2 computer, I get a few more errors:

PS D:\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1
MaxSize: 4096 / Type: uint64
Exception calling "GetODSyncStatus" with "4" argument(s): "Unable to load DLL 'ODSyncLib.dll': The specified module could not be found. (Exception from HRESULT:
0x8007007E)"
At D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42 char:5
+     $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DllNotFoundException

D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Call to GetODSyncStatus failed. HRESULT:
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1

D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Size: 0
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1

            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size
rodneyviana commented 1 month ago

You have to run it from the same folder where ODSyncLib.dll is located or provide the full path.

aakash-shah commented 1 month ago

Hello @rodneyviana! I am running this from the same folder but I continue to get this error. Here is some additional information. Let me know if you'd like me to test/do something else, or if I am running this incorrectly:

PS C:\Folder\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1
MaxSize: 4096 / Type: uint64
Exception calling "GetODSyncStatus" with "4" argument(s): "Unable to load DLL 'ODSyncLib.dll': The specified module could not be found. (Exception from HRESULT:
0x8007007E)"
At C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42 char:5
+     $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DllNotFoundException

C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Call to GetODSyncStatus failed. HRESULT:
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1

C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Size: 0
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1

            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size

PS C:\Folder\ODSyncUtil-64-bit> dir

    Directory: C:\Folder\ODSyncUtil-64-bit

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         3/21/2024  12:22 PM          15631 Get-ODStatus.ps1
-a----         3/21/2024  12:31 PM          16629 Get-ODStatusFromDLL.ps1
-a----         3/21/2024   2:10 PM          57032 ODSyncLib.dll
-a----         3/21/2024   2:07 PM       12488704 ODSyncLib.pdb
-a----         3/21/2024   2:09 PM          79560 ODSyncUtil.exe
-a----         3/21/2024   2:07 PM       12824576 ODSyncUtil.pdb

PS C:\Folder\ODSyncUtil-64-bit> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.3958
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.3958
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
rodneyviana commented 1 month ago

Is ODSyncUtil.exe working?

Get Outlook for iOShttps://aka.ms/o0ukef


From: aakash-shah @.> Sent: Friday, August 23, 2024 2:17:29 PM To: rodneyviana/ODSyncUtil @.> Cc: Mention @.>; Comment @.>; State change @.>; Subscribed @.> Subject: Re: [rodneyviana/ODSyncUtil] Get-ODStatusFromDLL Error (Issue #15)

Hello @rodneyvianahttps://github.com/rodneyviana! I am running this from the same folder but I continue to get this error. Here is some additional information. Let me know if you'd like me to test/do something else, or if I am running this incorrectly:

PS C:\Folder\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1 MaxSize: 4096 / Type: uint64 Exception calling "GetODSyncStatus" with "4" argument(s): "Unable to load DLL 'ODSyncLib.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" At C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42 char:5

C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Call to GetODSyncStatus failed. HRESULT: At line:1 char:1

C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Size: 0 At line:1 char:1

PS C:\Folder\ODSyncUtil-64-bit> dir

Directory: C:\Folder\ODSyncUtil-64-bit

Mode LastWriteTime Length Name


-a---- 3/21/2024 12:22 PM 15631 Get-ODStatus.ps1 -a---- 3/21/2024 12:31 PM 16629 Get-ODStatusFromDLL.ps1 -a---- 3/21/2024 2:10 PM 57032 ODSyncLib.dll -a---- 3/21/2024 2:07 PM 12488704 ODSyncLib.pdb -a---- 3/21/2024 2:09 PM 79560 ODSyncUtil.exe -a---- 3/21/2024 2:07 PM 12824576 ODSyncUtil.pdb

PS C:\Folder\ODSyncUtil-64-bit> $PSVersionTable

Name Value


PSVersion 5.1.22621.3958 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.22621.3958 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

— Reply to this email directly, view it on GitHubhttps://github.com/rodneyviana/ODSyncUtil/issues/15#issuecomment-2307674250 or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGT5MAQIM7GVRY5FXQZUFEDZS6DEVBFKMF2HI4TJMJ2XIZLTSOBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLLDTOVRGUZLDORPXI6LQMWWES43TOVSUG33NNVSW45FGORXXA2LDOOJIFJDUPFYGLKTSMVYG643JORXXE6NFOZQWY5LFVE3TKMBQGM3TOMZUQKSHI6LQMWSWS43TOVS2K5TBNR2WLKRSGIYDCNZZG42DKNFHORZGSZ3HMVZKMY3SMVQXIZI. You are receiving this email because you were mentioned.

Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

aakash-shah commented 1 month ago

Yes, the EXE and Get-ODStatus.ps1 work with no issues. I was just reporting that Get-ODStatus.ps1 didn't work for me in case you needed feedback on it (I'm good with just Get-ODStatus.ps1).

Thanks.

rodneyviana commented 1 month ago

Yes, the EXE and Get-ODStatus.ps1 work with no issues. I was just reporting that Get-ODStatus.ps1 didn't work for me in case you needed feedback on it (I'm good with just Get-ODStatus.ps1).

Thanks.

Glad ODSync is working as exe. If you want to continue troubleshooting the DLL

aakash-shah commented 1 month ago

ProcMon revealed it going through all of the paths in my Path variable and being unable to find ODSyncLib.dll. After temporarily adding the folder to my Path environment variable and trying it in a new PS window, it works.

So it looks like it's a bug that isn't correctly reading the DLL file from the current folder path.

aakash-shah commented 1 month ago

@rodneyviana Hello! No rush at all, but can you please re-open this so that it remains on your to do list since it has been closed out. Thanks!