Display: Cloud | List
Most Popular Tags
Results (794 total) All > code (x)
VB Code Problem (Array.FindAll(T) Method (System))
For '(s.Substring(s.Length - 4).ToLower() = "tops")' Would this not be better as 'If s.EndsWith("tops")' Would make for less error handling and would make the article read easier.
Last modified by The Computer Station on 2/6/2011 3:45:19 PM
Tags:  bad-code  code  contentbug  issue  much  ported  too
First sample - recoded in PowerShell (Custom Numeric Format Strings)
[double] $value = 123;$value.ToString("00000")# Displays 00123$value = 1.2;$value.ToString("0.00", [System.Globalization.CultureInfo]::InvariantCulture)# Displays 1.20$value.ToString("00.00",[System.Globalization.CultureInfo]::InvariantCulture)# Displays 01.20$value.ToString("00.00", [System.Globalization.CultureInfo]::CreateSpecificCulture("da-DK")) # Displays 01,20$value = .56$val
Last modified by Thomas Lee on 8/7/2012 5:58:28 PM
ComException is the base wrapper class for any COM error code. Because S.DS is built on ADSI all ADSI errors that aren’t directly understood by S.DS are wrapped in a COM exception and thrown. See the ADSI error list to look up the error code contained in the COM exception. - http://msdn.microsoft.com/en-us/library/windows/desktop/aa772195(v=vs.85).aspx
Last modified by Bruce Perler - Microsoft on 6/22/2012 4:32:03 PM
Tags:  adsi  code  comexception  error
GetAllNetworkInterfaces sample - rewritten in PowerShell (NetworkInterface.GetAllNetworkInterfaces Method (System.Net.NetworkInformation))
<#.SYNOPSIS This script shows the DNS Configuration of NICs in your system.DESCRIPTION This script is a re-write of an MSDN Sample using POwerSHell./ The sctipt gets all network active network interfaces then prints out that interfaces's DNS Properties..NOTES File Name : Show-DnsConfiguration.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell Ve
Last modified by Thomas Lee on 4/30/2012 4:22:51 PM
Sample Reworked Using PowerShell (NetworkInterface Class (System.Net.NetworkInformation))
<#.SYNOPSIS This script, shows details about the Network Interfaces on a system. This is a re-write of an MSDN script into PowerShell.DESCRIPTION This script Uses several .NET classes to get the details of the interfaces on the system, then displays these details. Note in the MSDN Script, there were calls to other MSDN Samples. To make things simple, I have removed these c
Last modified by Thomas Lee on 4/30/2012 1:21:38 PM
Sample Show-NetworkInterfaces recoded in PowerShell (PhysicalAddress Class (System.Net.NetworkInformation))
<#.SYNOPSIS This script displays the NICs in a system and their physical address..DESCRIPTION This script is a MSDN Sample recoded in PowerShell. The script first gets all the interfaces on the system, then loops through them displaying more information about them to the console.Note the use of Console.Write in the loop at the end. Not quite sure a better PowerShell equivalient o
Last modified by Thomas Lee on 4/29/2012 2:27:09 PM
A simple PowerShell example of using the Parse method of the PhysicalAddress class (PhysicalAddress.Parse Method (System.Net.NetworkInformation))
$IPAddress = ''Write-Host 'Test that the IP address works' $IP = Test-Connection -ComputerName $IPAddress -Count 1 -ErrorAction StopWrite-Host 'Get the mac address from arp'$Mac = (% arp -a $IP.Address)Write-Host 'Regex the output of Arp to get the mac address' $MacAddress = ($mac | ? { $_ -match $IP.Address } ) -match "([0-9A-F]{2}([:-][0-9A-F]{2}){5})"if ($Matches){ try {
Last modified by Thomas Lee on 4/29/2012 1:04:35 PM
Tags:  code  powershell  system.net
PowerShell (IAutomaticUpdates interface (Windows))
Here is a PowerShell script that will force the Windows Update agent to detect updates against the Microsoft Update servers. It will override any GPO settings in place, restart the Windows Update service, and force an update detection via the Windows Update Agent COM API. Remove-Item -Path HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate -Force -Recurse -ErrorAction SilentlyContinue; Stop
Last modified by Thomas Lee on 4/2/2012 1:28:59 PM
Sample - rewritten in PowerShell (Convert.ToInt32 Method (Double) (System))
<#.SYNOPSIS This script is a re-write of an MSDN sample which demonstrates rouding done by .NET (and therefore by PowerShell).DESCRIPTION This script creates an array of values then tries to convert them to a [double], catching errors. I've added two values from the MSDN C# sample. I also adjusted the formatting to line the numbers up better..NOTES File Name : .\Show-
Last modified by Thomas Lee on 3/15/2012 9:22:36 PM
Tags:  code  powershell
PowerShell scripts (Modify Reporting Services configuration files [AX 2012])
I have scripted this with PowerShell. Full post is here:http://dynamicsnavax.blogspot.com/2012/01/modify-microsoft-dynamics-ax-2012-ssrs.html
Last modified by Thomas Lee on 2/20/2012 4:43:15 PM
Tags:  code  external  powershell  script  ssrs
Page view tracker