Skip to content

Commit f80a1a0

Browse files
authored
Merge pull request #111779 from mgreenegit/patch-11
make compilation clear for new users
2 parents 1aebdb4 + e64c10d commit f80a1a0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

articles/governance/policy/how-to/guest-configuration-create-linux.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ end
119119

120120
Save this file with name `linux-path.rb` in a new folder named `controls` inside the `linux-path` directory.
121121

122-
Finally, create a configuration, import the **GuestConfiguration** resource module, and use the
123-
`ChefInSpecResource` resource to set the name of the InSpec profile.
122+
Finally, create a configuration, import the **PSDesiredStateConfiguration** resource module, and compile the configuration.
124123

125124
```powershell
126125
# Define the configuration and import GuestConfiguration
@@ -138,13 +137,19 @@ Configuration AuditFilePathExists
138137
}
139138
140139
# Compile the configuration to create the MOF files
140+
import-module PSDesiredStateConfiguration
141141
AuditFilePathExists -out ./Config
142142
```
143143

144+
Save this file with name `config.ps1` in the project folder. Run it in PowerShell by executing `./config.ps1`
145+
in the terminal. A new mof file will be created.
146+
144147
The `Node AuditFilePathExists` command isn't technically required but it produces a file named
145148
`AuditFilePathExists.mof` rather than the default, `localhost.mof`. Having the .mof file name follow
146149
the configuration makes it easy to organize many files when operating at scale.
147150

151+
152+
148153
You should now have a project structure as below:
149154

150155
```file
@@ -175,8 +180,8 @@ Run the following command to create a package using the configuration given in t
175180
```azurepowershell-interactive
176181
New-GuestConfigurationPackage `
177182
-Name 'AuditFilePathExists' `
178-
-Configuration './Config/AuditFilePathExists.mof'
179-
-ChefProfilePath './'
183+
-Configuration './Config/AuditFilePathExists.mof' `
184+
-ChefInSpecProfilePath './'
180185
```
181186

182187
After creating the Configuration package but before publishing it to Azure, you can test the package from your workstation or CI/CD environment. The GuestConfiguration cmdlet `Test-GuestConfigurationPackage` includes the same agent in your
@@ -196,7 +201,7 @@ Run the following command to test the package created by the previous step:
196201

197202
```azurepowershell-interactive
198203
Test-GuestConfigurationPackage `
199-
-Path ./AuditFilePathExists.zip
204+
-Path ./AuditFilePathExists/AuditFilePathExists.zip
200205
```
201206

202207
The cmdlet also supports input from the PowerShell pipeline. Pipe the output of

articles/governance/policy/how-to/guest-configuration-create.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,12 @@ Configuration AuditBitLocker
220220
}
221221
222222
# Compile the configuration to create the MOF files
223-
AuditBitLocker -out ./Config
223+
AuditBitLocker ./Config
224224
```
225225

226+
Save this file with name `config.ps1` in the project folder. Run it in PowerShell by executing `./config.ps1`
227+
in the terminal. A new mof file will be created.
228+
226229
The `Node AuditBitlocker` command isn't technically required but it produces a file named
227230
`AuditBitlocker.mof` rather than the default, `localhost.mof`. Having the .mof file name follow the
228231
configuration makes it easy to organize many files when operating at scale.

0 commit comments

Comments
 (0)