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

xRemoteFile always returns false in test #409

Closed
shurick81 opened this issue Apr 28, 2018 · 2 comments · Fixed by #570
Closed

xRemoteFile always returns false in test #409

shurick81 opened this issue Apr 28, 2018 · 2 comments · Fixed by #570
Labels
documentation The issue is related to documentation only. in progress The issue is being actively worked on by someone.

Comments

@shurick81
Copy link

As a devops, I expect to be able to test if the system is in desired state, including xRemoteFile resources. Here is an example of the resource I am applying:

        xRemoteFile SQLMediaArchive
        {
            Uri             = "http://$env:PACKER_HTTP_ADDR/SQLServer2014SP1.zip"
            DestinationPath = "C:\Install\SQLServer2014SP1.zip"
        }

First, I run Start-DscConfiguration and the file is downloaded successfully. Then I need to test that configuration is in desired state, so I run Test-DscConfiguration and I get False:

VERBOSE: An LCM method call arrived from computer WIN-SLU589M70V9 with user sid
 S-1-5-21-3913156103-666311135-156080423-500.
VERBOSE: [WIN-SLU589M70V9]: LCM:  [ Start  Compare  ]
VERBOSE: [WIN-SLU589M70V9]: LCM:  [ Start  Resource ]
[[xRemoteFile]SQLMediaArchive]
VERBOSE: [WIN-SLU589M70V9]: LCM:  [ Start  Test     ]
[[xRemoteFile]SQLMediaArchive]
VERBOSE: [WIN-SLU589M70V9]:
[[xRemoteFile]SQLMediaArchive] DestinationPath
'C:\Install\SQLServer2014SP1.zip' is existing file on the machine.
VERBOSE: [WIN-SLU589M70V9]:
[[xRemoteFile]SQLMediaArchive] Looking for cache path
'C:\ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache\MSF
T_xRemoteFile\1645172953'.
VERBOSE: [WIN-SLU589M70V9]:
[[xRemoteFile]SQLMediaArchive] No cache found for DestinationPath
'C:\Install\SQLServer2014SP1.zip' and Uri
'http://10.0.2.2:8328/SQLServer2014SP1.zip' CacheKey '1645172953'.
VERBOSE: [WIN-SLU589M70V9]:
[[xRemoteFile]SQLMediaArchive] Cache is empty or it doesn't reflect current
state. File will be downloaded.
VERBOSE: [WIN-SLU589M70V9]: LCM:  [ End    Test     ]
[[xRemoteFile]SQLMediaArchive] **False** in 0.1090 seconds.
VERBOSE: [WIN-SLU589M70V9]: LCM:  [ End    Resource ]
[[xRemoteFile]SQLMediaArchive]
VERBOSE: [WIN-SLU589M70V9]: LCM:  [ Start  Resource ]
@shurick81 shurick81 changed the title xRemoteFile xRemoteFile always returns false in test Apr 29, 2018
@shurick81
Copy link
Author

Setting MatchSource = $false helped. I think it would be nice to mention in documentation that by default it's $true.

@shurick81
Copy link
Author

shurick81 commented Apr 29, 2018

A pull request: #410

@johlju johlju added in progress The issue is being actively worked on by someone. documentation The issue is related to documentation only. labels May 1, 2018
mhendric added a commit that referenced this issue Feb 23, 2019
xRemoteFile: Updated documentation for MatchSource - Fixes #409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is related to documentation only. in progress The issue is being actively worked on by someone.
Projects
None yet
2 participants