Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

FileContent - new data input other there string

Đang mở
#1,731 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
powershell, yaml
Lĩnh vực
cli

Hướng nghiên cứu

Look at the FileContent resource implementation in the DSC v3 codebase, likely under a resources or providers directory. Understand how content is currently parsed and stored as a string. The goal is to allow a YAML multiline string (using '|') as input instead of requiring a single escaped string. Check existing tests for FileContent to see the expected format and add a test for the new input style.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Issue-Enhancement Needs Triage
Summary of the new feature / enhancement

Hi as Operation I like to use this resource to create web.config or CA.inf

Now when we have file that looks like this:


  [Version]
  Signature="$Windows NT$"

  [PolicyStatementExtension]
  Policies=InternalPolicy

  [InternalPolicy]
  OID=1.2.3.4.1455.67.89.5
  Notice="Legal Policy Statement"
  URL=https://pki.corp.contoso.com/pki/cps.txt

  [Certsrv_Server]
  RenewalKeyLength=2048
  RenewalValidityPeriod=Years
  RenewalValidityPeriodUnits=5
  CRLPeriod=Weeks
  CRLPeriodUnits=1
  LoadDefaultTemplates=0
  AlternateSignatureAlgorithm=1

  [CRLDistributionPoint]
  URL=http://pki.corp.contoso.com/cdp/WingtipToysRootCA.crl

  [AuthorityInformationAccess]
  URL=http://pki.corp.contoso.com/Public/myCA.crt

When I like to pass this to DSC v3 I nedd to convert this to string


$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json

resources:

- name: Test File
  type: Microsoft.Filesystem.File/Content
  properties:
    _exist: true
    path: C:\dsc\config\file-content\New\CAPolicy.inf
    content: "[string('[Version]\r\nSignature=\"$Windows NT$\"\r\n\r\n[PolicyStatementExtension]\r\nPolicies=InternalPolicy\r\n\r\n[InternalPolicy]\r\nOID=1.2.3.4.1455.67.89.5\r\nNotice=\"Legal Policy Statement\"\r\nURL=https://pki.corp.contoso.com/pki/cps.txt\r\n\r\n[Certsrv_Server]\r\nRenewalKeyLength=2048\r\nRenewalValidityPeriod=Years\r\nRenewalValidityPeriodUnits=5\r\nCRLPeriod=Weeks\r\nCRLPeriodUnits=1\r\nLoadDefaultTemplates=0\r\nAlternateSignatureAlgorithm=1\r\n\r\n[CRLDistributionPoint]\r\nURL=http://pki.corp.contoso.com/cdp/WingtipToysRootCA.crl\r\n\r\n[AuthorityInformationAccess]\r\nURL=http://pki.corp.contoso.com/Public/myCA.crt')]"

Proposed technical implementation details (optional)

Suggestion mayby how this can look like

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
  - name: ConfigureCertPolicy
    type: Microsoft.Windows/FileContent  # or Microsoft.DSC.Transitional/PowerShellScript
    properties:
      path: 'C:\Windows\CAPolicy.inf'
      content: |
        [Version]
        Signature="$Windows NT$"

        [PolicyStatementExtension]
        Policies=InternalPolicy

        [InternalPolicy]
        OID=1.2.3.4.1455.67.89.5
        Notice="Legal Policy Statement"
        URL=https://pki.corp.contoso.com/pki/cps.txt

        [Certsrv_Server]
        RenewalKeyLength=2048
        RenewalValidityPeriod=Years
        RenewalValidityPeriodUnits=5
        CRLPeriod=Weeks
        CRLPeriodUnits=1
        LoadDefaultTemplates=0
        AlternateSignatureAlgorithm=1

        [CRLDistributionPoint]
        URL=http://pki.corp.contoso.com/cdp/WingtipToysRootCA.crl

        [AuthorityInformationAccess]
        URL=http://pki.corp.contoso.com/Public/myCA.crt

Ngôn ngữ chính
Rust
Star
526
Fork
76
Merge trung bình
4 ngày 22 giờ
Pull request đã merge (30 ngày)
25

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/DSC

Tất cả issue của PowerShell/DSC

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.