DevOps Demos series: cFileShare module

2 02 2015

The cFileShare module is a part of the ALM Ranger DevOps solutions (vsardevops.codeplex.com), 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: https://vsardevops.codeplex.com/downloads/get/1423663..

Prerequisites

Get it

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

  • Click on Downloads

cFileShare_Unit_1

  • Click on the link “zip

cFileShare_Unit_2

  • Save the file in your system

Install it

After downloading the “Rangers_vsarDsc_everything.zip” 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 Resource.zip\Walkthrough – File Server and Share Custom Resource\

cFileShare_Unit_3

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

cFileShare_Unit_4

  • Check if DSC resources have been correctly imported

cFileShare_Unit_5

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
Advertisements

Actions

Information

2 responses

6 02 2015
4 03 2015

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s




%d bloggers like this: