DevOps Demos series: cFileShare module

2 02 2015

The cFileShare module is a part of the ALM Ranger DevOps solutions (, which consists of code as config guidance, quick reference posters and supporting resources.

cFileShare module contains the cCreateFileShare and cSetSharePermissions resources. These DSC Resources allow configuration of a node’s file share and share permission Rules.

Demo #1: cFileShare – get it, install it and run test cases

In this demo you will learn how to get, install and run the test cases for the cFileShare module. You can find the recording here:


Get it

As mentioned previously, cFileShare module is part of the DevOps initiative, which can be found in clodeplex ( For this demo, you will need to grab the full package named “”:

  • Click on Downloads


  • Click on the link “zip


  • Save the file in your system

Install it

After downloading the “” package execute the following steps:

  • Unzip it into a folder in order to access its content. The cFileShare resource is located in the <zip root>\Walkthrough – File Server and Share Custom\Walkthrough – File Server and Share Custom Resource\


  • Copying the cFileShare folder to $env:ProgramFiles\WindowsPowerShell\Modules
  • Check if module is being correctly recognized by running Get-Module –ListAvailable


  • Check if DSC resources have been correctly imported


Run test cases

After the installation procedure, unit tests will be located at $env:ProgramFiles\WindowsPowerShell\Modules\cFileShare\Unit Tests\. In order to execute them, execute the following steps:

Create File Share

  • Open a powershell console with elevated priveledges
  • Change to the Unit Tests folder

cd -d “$env:ProgramFiles\WindowsPowerShell\Modules\cFileShare\Unit Tests\”

  • Create the base test folder

md c:\test

  • Execute VSAR_cCreateFileShare_UnitTests.ps1 script

Assign permissions

  • Edit the file ps1
  • In the configuration area, adjust to your reality. In the demo user1 and user2 have been previously created as local accounts on the machine where the test is being executed:
    • #Variable Declarations
    • $ShareName = “TestShare”
    • $Users = @(“[domain]\[user1]”, “[domain]\[user2]”)
    • $Path = “C:\Test”
    • $User1 = “[domain]\[user1]”
    • $User2 = “[domain]\[user2]”
  • Open a powershell console with elevated priveledges
  • Change to the Unit Tests folder

cd -d “$env:ProgramFiles\WindowsPowerShell\Modules\cFileShare\Unit Tests\”

  • Create the base test folder (if not created previously)

md c:\test

  • Execute ps1 script



2 responses

6 02 2015
4 03 2015

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: