SPDocIcon - dsccommunity/SharePointDsc GitHub Wiki
Parameters
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| FileType | Key | String | Specifies the file type to configure the docicon for | |
| EditText | Write | String | Specifies the edit text for the file type | |
| Ensure | Write | String | Present to configure the file type. Absent is remove the file type | Present, Absent |
| IconFile | Write | String | Specifies the full path to the image file for the file type | |
| OpenControl | Write | String | Specifies the Open Control command for the file type |
Description
Type: Common Requires CredSSP: No
This resource is used to configure file type icons in the docicon.xml file. It allows to configure the icon, EditText and OpenControl parameter for a file type.
The resource only changes the server it is running on, so should be added to each server in the farm.
Note: Do NOT use a dot in the file type name! Only specify the extension. For example "pdf" instead of ".pdf".
Examples
Example 1
This example shows how configure a DocIcon for a file type and configure additional properties.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPDocIcon ConfigurePDFIcon
{
FileType = 'PDF'
IconFile = '\\server\share\icpdf.png'
EditText = 'Adobe Acrobat or Reader X'
OpenControl = 'AdobeAcrobat.OpenDocuments'
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
}
}
}
Example 2
This example shows how configure a DocIcon for a file type and configure additional properties.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPDocIcon RemovePDFIcon
{
FileType = 'PDF'
Ensure = "Absent"
PsDscRunAsCredential = $SetupAccount
}
}
}