
Anonymous Community User asked a question.
Folder stopped syncing: Get-SfClient : Object reference not set to an instance of an object.
Hello, We had a folder stop syncing it's files automatically to sharefile through powershell. I'm trying to make sense of the below error message, is anyone else experiencing the same issue or able to help? The error started yesterday Edit: the code we run is: Add-PSSnapIn ShareFileSet-ExecutionPolicy RemoteSigned$sfClient = Get-sfClient -Name “C:\\\\Sharefile\\\\Apipowershell.sfps”New-PSDrive -Name sfdrive -PSProvider ShareFile -Root “/” -Client $sfClientSync-SfItem -LocalPath “c:\\\\Scanback\\\\*.*” -Upload -ShareFilePath “/Shared Folders/PAS Scanback” -MoveRemove-PSDrive sfdriveThe error we receive is: PS C:\\\\Users\\\\Administrator> C:\\\\ShareFile\\\\PAS_Upload.ps1Get-SfClient : Object reference not set to an instance of an object.At C:\\\\ShareFile\\\\PAS_Upload.ps1:3 char:13+ $sfClient = Get-SfClient -Name 'C:\\\\Sharefile\\\\Apipowershell.sfps'+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-SfClient], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,ShareFile.Api.Powershell.GetSfClientNew-PSDrive : Cannot bind argument to parameter 'Client' because it is null.At C:\\\\ShareFile\\\\PAS_Upload.ps1:4 char:68+ ... rive -Name sfdrive -PSProvider ShareFile -Root '/' -Client $sfClient+ ~~~~~~~~~ + CategoryInfo : InvalidData: (:) [New-PSDrive], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.NewPSDriveCommandSync-SfItem : Unable to cast object of type 'System.Management.Automation.PSDriveInfo' to type 'ShareFile.Api.Powershell.ShareFileDriveInfo'.At C:\\\\ShareFile\\\\PAS_Upload.ps1:5 char:1+ Sync-SfItem -LocalPath 'c:\\\\Scanback\\\\*.*' -Upload -ShareFilePath '/Sha ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Sync-SfItem], InvalidCastException + FullyQualifiedErrorId : System.InvalidCastException,ShareFile.Api.Powershell.SyncSfItemRemove-PSDrive : Cannot find drive. A drive with the name 'sfdrive' does not exist.At C:\\\\ShareFile\\\\PAS_Upload.ps1:6 char:1+ Remove-PSDrive sfdrive+ ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (sfdrive:String) [Remove-PSDrive], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.RemovePSDriveCommand