One of the reasons I dump the file files to text files is that I am frequently in a position of being on a customer site without direct Internet access. If I have the files available then I can solve the problems. If you have Internet access then the help files are available on line […]
Archive for December, 2009
The use of modules to supply PowerShell based functionality in Windows 7\Windows 2008 R2 makes accessing the help files a little bit problematic. We have to have the module loaded to access the file. Sometimes I want to think through what I’m doing and research the help files before I dive into coding. To make […]
I have put the module of Access functions I’ve been blogging about over the last few weeks onto my SkyDrive at http://cid-43cfa46a74cf3e96.skydrive.live.com/browse.aspx/PowerShell%20Scripts/AccessFunctions The file is alos attached to this post. The usual warnings apply. This is a work in progress and subject to change. All scripts, and the module, are presented as is with no […]
I do quite a lot with modules as you can tell from my posts over the last few months and have bit a fair collection of modules. One issue I find when loading a module is that I can’t always remember the name of the commands that the module creates. If we use Import-Module -Name […]
In case you were wondering why the WMI based posts seem to have dried up – I have opened a new blog http://itknowledgeexchange.techtarget.com/powershell/ Just for PowerShell and WMI. I figure there is enough subject matter in the topic to support a separate site. I will be covering the rest of the PowerShell world from here. […]
Delete Access Table
Posted by: | December 11, 2009 | No Comment |This times lets go mad and delete a whole table. 001 002 003 004 005 006 007 008 009 010 011 function Remove-AccessTable { [CmdletBinding(SupportsShouldProcess=$true)] param ( [string]$table, [System.Data.OleDb.OleDbConnection]$connection ) $sql = "DROP TABLE $table " $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection) if ($psCmdlet.ShouldProcess("$($connection.DataSource)", "$sql")){$cmd.ExecuteNonQuery()} } Again we use the SupportsShouldProcess – have to love the amount of functionality we get […]
Delete an Access Column
Posted by: | December 11, 2009 | No Comment |We have seen how to add a column to our access database – what about removing a column? 001 002 003 004 005 006 007 008 009 010 011 012 function Remove-AccessColumn { [CmdletBinding(SupportsShouldProcess=$true)] param ( [string]$table, [string]$column, [System.Data.OleDb.OleDbConnection]$connection ) $sql = "ALTER TABLE $table DROP COLUMN $column" $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection) if ($psCmdlet.ShouldProcess("$($connection.DataSource)", "$sql")){$cmd.ExecuteNonQuery()} } We […]
Add a column to an Access Table
Posted by: | December 10, 2009 | No Comment |Now we have created our Table we can start adding columns 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 […]
New Access Table
Posted by: | December 10, 2009 | No Comment |I have already presented a function to create a new access table but I wasn’t very happy with it because we had to supply the full table creation SQL script. I have altered that function so it creates an empty table. We can then use the Add-AccessColumn function to add columns. This also means I […]
Creating Objects
Posted by: | December 5, 2009 | 1 Comment |There is a post on the PowerShell Team blog about using New-Object – http://blogs.msdn.com/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx The –property parameter discussed in this post is something that I had only come across recently. In a number of recent posts I have used Add-Type to create a new object by using C# code to define a new class rather […]
Categories
- .NET
- Active Directory
- Architecture
- Azure
- Bash
- BITS
- Books
- CDXML
- CIM
- Cloud
- COM
- Containers
- Deep Dive
- Desired State Configuration
- DevOps
- DHCP
- DNS
- DSC
- European Summit
- Events
- Exchange
- File System
- Firewall
- General
- General IT Matters
- Hyper-V
- IIS
- Infrastructure
- IT Community
- IT Security
- Learning PowerShell
- Linux
- Math
- Microsoft
- Modules
- Nano Server
- Networking
- Office 2010
- Office 2013
- Open Source
- Opinion
- Outlook
- Philosophy
- PowerShell
- PowerShell 7
- PowerShell and .NET
- PowerShell and Active Directory
- PowerShell and CIM
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- PowerShell Basics
- PowerShell original
- PowerShell Summit
- PowerShell User Group
- PowerShell User Group 2
- PowerShell v2
- PowerShell V3
- PowerShell v4
- PowerShell v5
- PowerShell v6
- PowerShell.org
- PowerShellGet
- PowerShellV2
- PSAM
- Rant
- Registry
- Scripting
- Scripting Games
- Scripting Games 2104
- Security
- SQL Server
- Storage
- Strings
- Summit
- Technology
- Uncategorized
- Virtualization
- Windows 10
- Windows 2012 R2
- Windows 7
- Windows 8
- Windows 8 Server
- Windows 8.1
- Windows Server
- Windows server 1709
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
- WMFv5
- WPF
- WSUS