Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic link errors on subsequent applys #87

Open
ScottGuymer opened this issue Jul 23, 2019 · 0 comments
Open

Symbolic link errors on subsequent applys #87

ScottGuymer opened this issue Jul 23, 2019 · 0 comments

Comments

@ScottGuymer
Copy link

I am using the symbolic link resource and it applies successfully the first time and creates the link correctly. But on subsequent runs, it fails.

I think its something to do with the test function as it seems to think that the link doesn't exist and tries to re-create it when it already exists.

My DSC config is

    $documents = [Environment]::GetFolderPath("MyDocuments")    
    cSymbolicLink powershellProfileLink {
      Ensure          = "Present"
      SourcePath      = "C:\code\powershell-profile\"
      DestinationPath = "$documents\WindowsPowerShell\"
      DependsOn       = "[cGitRepository]powershellProfile"
    }

the error message is.

VERBOSE: [NLYBSTQVP4NB88O]: LCM:  [ Start  Resource ]  [[cSymbolicLink]powershellProfileLink]
VERBOSE: [NLYBSTQVP4NB88O]: LCM:  [ Start  Test     ]  [[cSymbolicLink]powershellProfileLink]
VERBOSE: [NLYBSTQVP4NB88O]: LCM:  [ End    Test     ]  [[cSymbolicLink]powershellProfileLink]  in 0.0590 seconds.
VERBOSE: [NLYBSTQVP4NB88O]: LCM:  [ Start  Set      ]  [[cSymbolicLink]powershellProfileLink]
VERBOSE: [NLYBSTQVP4NB88O]:                            [[cSymbolicLink]powershellProfileLink] DestinationPath : 'C:\Users\320047825\OneDrive - Philips\Documents\WindowsPowerShell\',  SourcePath :
'C:\code\powershell-profile\', IsDirectory : 'False'
Exception calling "CreateSymLink" with "3" argument(s): "Cannot create a file when that file already exists"
    + CategoryInfo          : NotSpecified: (:) [], CimException
    + FullyQualifiedErrorId : Win32Exception
    + PSComputerName        : localhost

VERBOSE: [NLYBSTQVP4NB88O]: LCM:  [ End    Set      ]  [[cSymbolicLink]powershellProfileLink]  in 0.1390 seconds.
The PowerShell DSC resource '[cSymbolicLink]powershellProfileLink' with SourceInfo 'C:\code\windows-dev-config\devMachineConfig.ps1::85::5::cSymbolicLink' threw one or more non-terminating errors while running
the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

VERBOSE: [NLYBSTQVP4NB88O]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 18.029 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant