Display: Cloud | List
Most Popular Tags
Results (5 total) All > powershell (x) > system.io.file (x)
Sample Using PowerShell (File.OpenText Method (System.IO))
<#.SYNOPSIS This script creates a file, then reads it and displays the output..DESCRIPTION This script reimplements the MSDN sample for this page. It first creates a file (assuming the file does not already exist) and writes three lines to it. The script then opens the file, reads each line and displays it..NOTES File Name : Copy-File2.ps1 Author : Thomas Lee - tfl@psp.co
Last modified by Thomas Lee on 7/18/2010 3:49:20 PM
Sample Using Powershell (File.CreateText Method (System.IO))
<#.SYNOPSIS This script creates a file, then reads it and displays the output..DESCRIPTION This script reimplements the MSDN sample for this page. It first creates a file (assuming the file does not already exist) and writes three lines to it. The script then opens the file, reads each line and displays it..NOTES File Name : Copy-File2.ps1 Author : Thomas Lee - tfl@psp.co
Last modified by Thomas Lee on 7/18/2010 3:48:59 PM
Script Using PowerShell (File Class (System.IO))
<#.SYNOPSIS This script creates a file, then reads it and displays the output..DESCRIPTION This script reimplements the MSDN sample for this page. It first creates a file (assuming the file does not already exist) and writes three lines to it. The script then opens the file, reads each line and displays it..NOTES File Name : Copy-File2.ps1 Author : Thomas Lee - tfl@psp.co
Last modified by Thomas Lee on 7/18/2010 3:48:36 PM
Example in PowerShell (ICertAdmin2::GetCRL method (Windows))
# Create admin object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1"# Get CRL to Base64 encoded format $CRL = $CertAdmin.GetCRL("ServerName\CAName", 1)# Convert Base 64 string to byta array$bytes = [System.Convert]::FromBase64String($CRL)# Write this array to regular .CRL file[System.IO.File]::WriteAllBytes('file.crl', $bytes)# to open this file, just invoke it & .\file.crl
Last modified by Thomas Lee on 10/24/2009 2:01:48 PM
Sample using PowerShell (File.Exists Method (System.IO))
<#.SYNOPSIS This script displays the usage of the Exists and the copy methods of System.IP.File .DESCRIPTION This script sets up two file names, then checks to see if the sorucefile exists. if so, it's copied to a new file..NOTES File Name : copy-file.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell V2 CTP3.LINK This script posted to: http://w
Last modified by Thomas Lee on 7/19/2009 6:50:18 PM
Page view tracker