Giter Site home page Giter Site logo

dscresources's Introduction

DSCResources

Custom DSC resource modules by PowerShell Magazine.


Custom DSC resource modules in this repository are packaged as different categories based on the functionality.

  • WMI Permanent Events Module (cWMIPermanentEvents)

    • cWMIEventFilter is used to create event filter instances for a given event query and event namespace.
    • cWMIEventBinding is used to create binding between an event filter instance and an event consumer instance.
    • cWMIEventLogConsumer is used to create an instance of WMI Event Log consumer that writes to application log in response to an event.
    • cWMILogFileConsumer is used to create an instance of WMI Log File that writes to a text log file in response to an event.
    • cWMIActiveScriptConsumer is used to create an instance of WMI Active Script Consumer that executes a specified VBScript file and VBScript text fragment in response to an event.
    • cWMICommandLineConsumer is used to create an instance of WMI CommandLine Consumer that executes a native application or a batch script in response to an event.
    • cWMISMTPConsumer is used to create an instance of WMI SMTP Consumer that sends an email in response to an event.
  • Windows OS Miscellaneous Module (cWindowsOS)

    • cAutoAdminLogon is used to add or remove auto administrator logon configuration. This is a composite resource.
    • cLoopBackCheck is used to enable or disable Loopback Check registry setting for web servers such as SharePoint Front End servers. This is a composite resource.
    • cDiskImage is used to mount or dismount ISO images.
  • Microsoft Monitoring Agent (cMMAgent)

    • cMMAgentInstall is used to install Microsoft Monitoring Agent.
    • cMMAgentProxyName is used to add or remove the proxy URL for the Microsoft Monitoring Agent configuration.
    • cMMAgentProxyCredential is used to add, modify, or remove the credentials that need to be used to authenticate to a proxy configured using cMMAgentProxyName resource.
    • cMMAgentOpInsights is used to enable or disable Azure Operational Insights within the Microsoft Monitoring Agent. This can also be used to update the WorkspaceID and WorkspaceKey for connecting to Azure Operational Insights.
    • cMMAgentAD is used to enable or disable Active Directory integration for the Microsoft Management Agent. By enabling AD integration, you can assign agent-managed computers to management groups.
    • cMMAgentManagementGroups DSC resource can be used to add or remove management groups. You can use this resource to update the action account credentials for the management agent service.
  • Microsoft Azure Recovery Services (MARS) agent (cMicrosoftRecoveryServicesAgent)

    • cMARSAgentInstall is used to install Microsoft Azure Recovery Services Agent. This is a composite resource that uses Package resource behind the scenes.
    • cMARSProxy is used to configure the proxy settings for the MARS agent to connect to the Azure Backup Vault.
    • cMARSRegistration DSC resource should be used to register a target system with the Azure backup vault.
    • cMARSEncryptionPhrase is used to configure the encryption settings for the MARS agent service.
  • Microsoft Hyper-V (cHyper-V)

    • cVMSwitch is used to create virtual machine switches.
    • cVMNetworkAdapter is used to create VM network adapters to attach to either management OS or the virtual machines.
    • cVMNetworkAdapterSettings is used to configure VM network adapter settings such as bandwidth weights, port mirroring, DHCP guard, MAC address spoofing, etc.
    • cVMNetworkAdapterVlan is used to configure VLANs on virtual network adapters either in the management OS or virtual machines.
    • cVMIPAddress is used to inject IP Address into a virtual machine running on Hyper-V host.
    • cWaitForVMGuestIntegration is used to ensure that the VM integration components are running. This will be useful when you want to wait until a VM completes reboot and then perform an action.
  • Microsoft Visual Studio Code (cHyper-V)

These modules are available on PowerShellGallery.com. If you are using Windows PowerShell 5.0 or Packagemanagement module on PowerShell 4.0, you can install these modules using PowerShellGet module.

Install-Module -Name cMMAgent
Install-Module -Name cWindowsOS
Install-Module -Name cWMIPermanentEvents
Install-Module -Name cMicrosoftAzureRecoveryServices
Install-Module -Name cHyper-V
Install-Module -Name vscode

dscresources's People

Contributors

gerane avatar iainbrighton avatar jberezanski avatar mgreenegit avatar nicholasdille avatar rchaganti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dscresources's Issues

New version?

The update to the productid is a major change. Can you update the version (1.3?) and submit to the gallery?

It would also be good to add a release history to the ReadMe.

If you would like to hookup the repo to the gallery so changes automatically publish a new version, I have an example AppVeyor file here:
https://github.com/mgreenegit/WSManTrust/blob/master/appveyor.yml

vscodeextension not working

I'm trying to get winget configure set up with the vscode/vscodeextension module.

YAML config:
- resource: vscode/VSCodeExtension
directives:
description: Install VSCode PowerShell Extension
allowPrerelease: true
settings:
Name: ms-vscode.PowerShell
Ensure: Present

winget reports that it will install the extension:
image

and it also reports the extension as installed after running:
image

However when i open vscode my extensions are not there.

I looked at the module directly:

Seems ok:
image

I think the problem is in the vscodeextension module, it seems to return true when vscode is not found. Despite vscode being installed on my local machine.
image

It seems the regkey which is used to check the vscode version is no longer working:
image

Can anyone confirm this is the issue or am i missing something?

cMMA Agent is not in Powershell Gallery

Does not work:
Install-Module -Name cMMAgent
No match was found for the specified search criteria and module name 'cMMAgent'.

From Gallery:
Search for cmmaagent returned 0 packages

Works:
Install-Module -Name cWindowsOS
Install-Module -Name cWMIPermanentEvents
Install-Module -Name cMicrosoftAzureRecoveryServices
Install-Module -Name cHyper-V
Install-Module -Name vscode

[vscode] Get-InstalledExtension function not emiting any output if no extensions are installed

There is a small bug due to which the verbose message 'No extensions installed.' is not getting displayed in case the directory "$env:HOMEPATH.vscode\extensions" exists but is empty. This is because Get-ChildItem will return $null and foreach won't get processed.

foreach ($item in (Get-ChildItem $extensionPath))

I tried to correct it, please see attached file.
PS : I'm a first-time github user.

Get-InstalledExtension.txt

Input on code-insiders support.

I am wanting to add support for VSCode Insiders Build, and wanted to get your input on how you would like to see that done.

Differences

  • CLI Script: code-insiders.cmd vs code.cmd
  • Extension Directory: $home\.vscode-insiders\extensions vs $home\.vscode\extensions
  • Uninstall String: Microsoft Visual Studio Code Insiders vs Microsoft Visual Studio Code

VSCodeSetup.psm1

  • Line 62 - Dir=C:\Program Files (x86)\Microsoft VS Code
  • Line 63 - Group=Visual Studio Code
  • Line 173 - $products = Get-ItemProperty -Path $UninstallKey | Select DisplayName, DisplayVersion, InstallLocation, UninstallString
  • Line 176 - return $products.Where({$_.DisplayName -eq 'Microsoft Visual Studio Code'})

VSCodeExtensions.psm1

  • Line 70 - $commandLine = "/c"$($vsCodeInstall.InstallLocation)\bin\code.cmd" --install-extension ${Name}"
  • Line 91 - $commandLine = "/c"$($vsCodeInstall.InstallLocation)\bin\code.cmd" --uninstall-extension ${Name}"
  • Line 196 - $extensionPath = "$env:HOMEPATH\.vscode\extensions"
  • Line 278 - if ($products.DisplayName -contains 'Microsoft Visual Studio Code')
  • Line 280 - return $products.Where({$_.DisplayName -eq 'Microsoft Visual Studio Code'})

I am a bit new to DSC Resources, so I am currently trying to read up on them to better understand how to best implement something like this. Normally i'd likely just add an Insiders switch to toggle over to insiders, but I'm not quite sure if that is an option in a DSC Resource or not.

VSCode - Shell extensions are not added during DSC

Using the DSC snippet as below, VS code doesn't seem to install the shell extensions.. I checked HKEY_Classes_Root/*/shell and HKEY_Classes_Root/Directory/shell and the VSCode keys were not there. After manually running the VSCode installer and selecting the shell extensions as install options, the keys appeared.

    if ($VSCode) {
        xRemoteFile VSCodeInstaller {
            Uri             = "https://go.microsoft.com/fwlink/?LinkID=623230"
            DestinationPath = "C:\VSCodeSetup.exe"
            MatchSource     = $false
        }
        
        VSCodeSetup VSCode {
            IsSingleInstance = "yes"
            Path             = "C:\VSCodeSetup.exe"
            DependsOn        = "[xRemoteFile]VSCodeInstaller"
        }
    }

error in DSC resource cNetworkAdapter.psm1 version 2.6.1

Hello,

I played a little bit with your DSC resource cNetWorkAdapter v. 2.6.1 and detected a script error in that module. In the function Test-TargetResource in line 221 you check with Get-VMNetworkAdapter if the specified netadapter exists and assign the result to variable $NetAdapterExists. However in the following script code you only reference a variable $AdapterExists, which is nowhere defined. So Test-TargetResource in some cases returns a wrong result.

I have changed the function code to always using the variable $NetAdapterExists and now it seems that Test-TargetResource returns always correct results (see the changed in my attached file).

It would be nice if you could take account of these changes in future versions.

Best regards
Gerhard Glenk

cVMNetworkAdapter.psm1.zip

cMMAgentOpsInsights not changing workspace ID and KEY

I'm looking at your DSC resource to use it within Azure DSC, but your custom DSC resource doesn't seem to change the workspace ID and Key.

Configuration MMAgentConfiguration
{
$OPSINSIGHTS_WS_ID = Get-AutomationVariable -Name "LA_WA_ID_02"
$OPSINSIGHTS_WS_KEY = Get-AutomationVariable -Name "LA_WA_KEY_02"

Import-DscResource -ModuleName cMMAgent

Node OMSnode {
cMMAgentOpInsights MMAgentOpInsights {
WorkspaceID = $OPSINSIGHTS_WS_ID
WorkspaceKey = $OPSINSIGHTS_WS_KEY
Ensure = 'Present'
}
}
}

Repository does not have a license specified.

Hey,
I just wanted to see if you could add a LICENSE file to your repo to let us know what license it is distributed under. Without an appropriate license it may be hard if not impossible for others to use the resources you make available in this module.

My vote would be the use the MIT license similar to how the rest of the PowerShell project is licensed.

MMAgent - updated product ID

It seems like the MM Agent has gotten a new product ID. At least the one I'm using got a different ID than the one in the DSC Resource:
8A7F2C51-4C7D-4BFD-9014-91D11F24AAE2

The error when applying a DSC configuration using the resource:
PowerShell DSC resource MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: Package from C:\Windows\Temp\MMASetup-AM
D64.exe was installed, but the specified ProductId and/or Name does not match package details

cVMSwitch: should support single adapter embedded teams

In the Test-TargetResource, SET is only enabled if there is -gt 1 adapter specified. There are a few reasons why customers would enable embedded teaming on a single adapter

Proposal: Add a new param (EmbeddedTeamingEnabled) to specify that this should be a SET team rather than the number of adapters.

if ($switch.EmbeddedTeamingEnabled)...

cVMNetworkAdapterVlan Issue

HI ,

I'm trying to set up Vlans for 2 VM Machine but I'm getting following errors .

Add-NodeKeys : The key properties combination 'Network Adapter::False' is
duplicated for keys 'Name,ManagementOS' of resource 'cVMNetworkAdapterVlan' in node .

I would appreciate any help .

 cVMNetworkAdapterVlan VLAN {
  ManagementOS = $false
  Name = "Network Adapter"
  VMName = "windows8"
  VlanId = 10
  AdapterMode = "Access"

  }

 cVMNetworkAdapterVlan VLAN1 {
  ManagementOS = $false
  Name = "Network Adapter"
  VMName = "s2"
  VlanId = 10
  AdapterMode = "Access"

  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.